<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[NFS Backups and Xen Orchestra]]></title><description><![CDATA[<p dir="auto">I want to confirm a couple things about Xen Orchestra and NFS backups.</p>
<ol>
<li>Running Mount from XOA</li>
</ol>
<p dir="auto">When I go to Settings -&gt; Remotes and try to add an NFS remote, it looks like Xen Orchestra wants to run <code>mount</code> on the XOA VM to mount it. That implies that the web server is running as <code>root</code> or the web server has the ability to invoke commands as root, because only root can mount filesystems. That seems decidedly suboptimal from a security point of view. If I run xo-web as root and there's an input validation error, then I not only have command injection, but I have commands injected that are running as root.</p>
<p dir="auto">Imagine someone types <code>ver=3; echo blah | tee -a /etc/shadow; :</code> or similar as their options on the NFS remote. That potentially executes as root and does something nasty (where <code>blah</code> is a correctly formatted /etc/shadow entry).</p>
<p dir="auto">I could potentially create a rule in my <code>/etc/sudoers</code> file to allow the unprivileged <code>www</code> user to invoke <code>/bin/mount</code> as root with no password, but I'm still not sure how exposed I would be to command injection. The risk is limited to that one command, but it's still sorta there. We'd have to change the mount command that is executed to be <code>sudo mount</code>, instead of <code>mount</code>.</p>
<ol start="2">
<li>Dataflow</li>
</ol>
<p dir="auto">If I follow the flow, the hypervisor will transmit the VM's data for backup to my XOA VM, who in turn writes it out to the NFS volume. If my XOA instance is not on the same network or host, that's a bad idea, right? I mean: it would be better for the host to do the NFS mount from the hypervisor and write the data out to the NFS share directly, wouldn't it? Even if my XOA VM is on the same host, the data is transmitted into the VM and back out again. Do I understand this correctly?</p>
]]></description><link>https://xcp-ng.org/forum/topic/3176/nfs-backups-and-xen-orchestra</link><generator>RSS for Node</generator><lastBuildDate>Sat, 10 Oct 2026 17:22:31 GMT</lastBuildDate><atom:link href="https://xcp-ng.org/forum/topic/3176.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 17 Jun 2020 20:42:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to NFS Backups and Xen Orchestra on Thu, 18 Jun 2020 19:41:00 GMT]]></title><description><![CDATA[<p dir="auto">Doc now updated with 2 pictures here: <a href="https://xen-orchestra.com/docs/proxy.html#architecture" target="_blank" rel="noopener noreferrer nofollow ugc">https://xen-orchestra.com/docs/proxy.html#architecture</a></p>
]]></description><link>https://xcp-ng.org/forum/post/27890</link><guid isPermaLink="true">https://xcp-ng.org/forum/post/27890</guid><dc:creator><![CDATA[olivierlambert]]></dc:creator><pubDate>Thu, 18 Jun 2020 19:41:00 GMT</pubDate></item><item><title><![CDATA[Reply to NFS Backups and Xen Orchestra on Thu, 18 Jun 2020 18:58:11 GMT]]></title><description><![CDATA[<p dir="auto">Indeed, it's on the blog post but not in the doc. It's:</p>
<p dir="auto"><img src="https://xen-orchestra.com/blog/content/images/2019/04/withproxy-2.png" alt="" class="img-markdown  img-fluid" /></p>
<p dir="auto">As visible here: <a href="https://xen-orchestra.com/blog/backup-proxies/" target="_blank" rel="noopener noreferrer nofollow ugc">https://xen-orchestra.com/blog/backup-proxies/</a></p>
<p dir="auto">I'm updating the doc right now.</p>
]]></description><link>https://xcp-ng.org/forum/post/27887</link><guid isPermaLink="true">https://xcp-ng.org/forum/post/27887</guid><dc:creator><![CDATA[olivierlambert]]></dc:creator><pubDate>Thu, 18 Jun 2020 18:58:11 GMT</pubDate></item><item><title><![CDATA[Reply to NFS Backups and Xen Orchestra on Thu, 18 Jun 2020 17:58:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/olivierlambert" aria-label="Profile: olivierlambert">@<bdi>olivierlambert</bdi></a> The proxy page has a pretty decent diagram for what things look like when there is no proxy. But it doesn't have a diagram for what things look like if there IS a proxy. I'm trying to understand it. Does this diagram capture the two situations?</p>
<p dir="auto">If you're running 2 sites using a single instance of Xen Orchestra, is this what happens?<br />
<img src="/forum/assets/uploads/files/1592503079722-xoa-backup.png" alt="xoa-backup.png" class="img-markdown  img-fluid" /></p>
]]></description><link>https://xcp-ng.org/forum/post/27884</link><guid isPermaLink="true">https://xcp-ng.org/forum/post/27884</guid><dc:creator><![CDATA[paco]]></dc:creator><pubDate>Thu, 18 Jun 2020 17:58:28 GMT</pubDate></item><item><title><![CDATA[Reply to NFS Backups and Xen Orchestra on Thu, 18 Jun 2020 04:56:31 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto">Unless the <a href="#shell"><code>shell</code></a> option is used, no shell interpreter (Bash, <code>cmd.exe</code>, etc.) is used, so shell features such as variables substitution (<code>echo $PATH</code>) are not allowed.</p>
<p dir="auto">-- <a href="https://github.com/sindresorhus/execa#execafile-arguments-options" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/sindresorhus/execa#execafile-arguments-options</a></p>
</blockquote>
<p dir="auto">AFAIU, <code>execa</code> use <code>spawn</code> which does not do any arguments parsing, those are passed verbatim to the underlying command (probably via a call to <a href="https://linux.die.net/man/3/execvp" target="_blank" rel="noopener noreferrer nofollow ugc"><code>execvp</code></a>).</p>
<p dir="auto">If we would have used the <code>shell</code> option, this command would indeed run a shell which would have parsed the command line and therefore be susceptible to injection, but we are not using this <img src="https://xcp-ng.org/forum/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=1d3f495298e" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:1.4em;width:auto;vertical-align:middle" title=":-)" alt="🙂" /></p>
]]></description><link>https://xcp-ng.org/forum/post/27849</link><guid isPermaLink="true">https://xcp-ng.org/forum/post/27849</guid><dc:creator><![CDATA[julien-f]]></dc:creator><pubDate>Thu, 18 Jun 2020 04:56:31 GMT</pubDate></item><item><title><![CDATA[Reply to NFS Backups and Xen Orchestra on Thu, 18 Jun 2020 03:54:31 GMT]]></title><description><![CDATA[<p dir="auto">NodeJS is not my best language. But it looks <code>_mount.js</code> uses the execa library to wrap around standard child-process stuff.</p>
<p dir="auto">I did a little bit of code reading and it looks like, ultimately, execa and child-process-promise end up invoking child_process.spawn(), and it seems like spawn() is just an asynchronous wrapper around <code>child_process.exec()</code>. This leads me to believe that the input ultimately ends up on a shell command line.</p>
<p dir="auto">According to the <a href="https://nodejs.org/api/child_process.html#child_process_child_process" target="_blank" rel="noopener noreferrer nofollow ugc">docs I found</a>:</p>
<blockquote>
<p dir="auto"><code>child_process.exec()</code>: spawns a shell and runs a command within that shell, passing the stdout and stderr to a callback function when complete</p>
</blockquote>
<p dir="auto">Now, both execa and the child-process-promise library do a lot of parsing of arguments. I can't tell to what extent that parsing and marshalling of command line arguments actually defeats injection attacks. I've done a lot of code review in my day, and sometimes I miss the line that does the work of defeating injection attacks because it is terse and effective. I might have looked right at it and misunderstood its importance.</p>
<p dir="auto">Like I said, NodeJS and all the modules that are getting loaded in here to make this happen is difficult for me to follow. It's not my strong suit. Sorry if I'm wasting your time because I can't follow the code flow. It looks to me like it all boils down to exec(), and exec() by definition invokes the shell. But maybe we're protected by one of the argument marshalling functions in the call chain.</p>
]]></description><link>https://xcp-ng.org/forum/post/27848</link><guid isPermaLink="true">https://xcp-ng.org/forum/post/27848</guid><dc:creator><![CDATA[paco]]></dc:creator><pubDate>Thu, 18 Jun 2020 03:54:31 GMT</pubDate></item><item><title><![CDATA[Reply to NFS Backups and Xen Orchestra on Thu, 18 Jun 2020 03:28:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/julien-f" aria-label="Profile: julien-f">@<bdi>julien-f</bdi></a> Yeah, I have just found the <code>useSudo</code> option in the docs. I swear things change fast enough on xen orchestra that "upgrading" almost doesn't make sense. I rebuild it like every 3-6 months and so much changes that it's almost easier to start over. If I had started over and pretended I didn't know anything, I would have read the documentation and seen the useSudo option. That's not a complaint. Fast development and adding features is awesome.</p>
]]></description><link>https://xcp-ng.org/forum/post/27847</link><guid isPermaLink="true">https://xcp-ng.org/forum/post/27847</guid><dc:creator><![CDATA[paco]]></dc:creator><pubDate>Thu, 18 Jun 2020 03:28:13 GMT</pubDate></item><item><title><![CDATA[Reply to NFS Backups and Xen Orchestra on Wed, 17 Jun 2020 21:24:47 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">XO can use <code>sudo mount</code>: <a href="https://github.com/vatesfr/xen-orchestra/blob/bf763d2cf474293e5a0fa1f3a06fd1733a495b34/packages/xo-server/config.toml#L114" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/vatesfr/xen-orchestra/blob/bf763d2cf474293e5a0fa1f3a06fd1733a495b34/packages/xo-server/config.toml#L114</a> <img src="https://xcp-ng.org/forum/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=1d3f495298e" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:1.4em;width:auto;vertical-align:middle" title=":-)" alt="🙂" /></p>
<p dir="auto">I don't believe command injection is possible because <code>mount</code> is called directly, no shell is used to parse the command line.</p>
]]></description><link>https://xcp-ng.org/forum/post/27842</link><guid isPermaLink="true">https://xcp-ng.org/forum/post/27842</guid><dc:creator><![CDATA[julien-f]]></dc:creator><pubDate>Wed, 17 Jun 2020 21:24:47 GMT</pubDate></item><item><title><![CDATA[Reply to NFS Backups and Xen Orchestra on Wed, 17 Jun 2020 21:14:17 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<ol>
<li>Ping <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/julien-f" aria-label="Profile: julien-f">@<bdi>julien-f</bdi></a> about this</li>
<li>That's correct and there's a good reason to that. When we ask XenServer/XCP-ng to export a VM disk, <strong>it doesn't push data</strong>. It only expose an HTTP handler so we can <strong>pull</strong> data. Remember that we are doing everything through XAPI and there's 0 SSH calls. So there's no way to ask a host to push data to a NFS host. However, this limitation is solved by using XO proxies, which are available in XOA since last release <img src="https://xcp-ng.org/forum/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=1d3f495298e" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:1.4em;width:auto;vertical-align:middle" title=":)" alt="🙂" /> See <a href="https://xen-orchestra.com/docs/proxy.html" target="_blank" rel="noopener noreferrer nofollow ugc">https://xen-orchestra.com/docs/proxy.html</a></li>
</ol>
]]></description><link>https://xcp-ng.org/forum/post/27841</link><guid isPermaLink="true">https://xcp-ng.org/forum/post/27841</guid><dc:creator><![CDATA[olivierlambert]]></dc:creator><pubDate>Wed, 17 Jun 2020 21:14:17 GMT</pubDate></item></channel></rss>