"is single user in each VM because it is assumed that the kernel is not trustworthy."
Can you elaborate it a bit? I don't get what you mean. Are you assuming that compromising a jailed an unprivileged web browser is the same as running it as root?
In the Qubes model, yes. Also has proven true in every single
PwnToOwn to date.
"higher security and performance can perhaps be achieved by using stuff like unikernels running stripped-down apps or services"100% agree.
"why publish a PDF? It's not linkable, hard to quote... Why not a post on a blog?"Not linkable...? I don't have a blog. Maybe I should start one. Thanks for the suggestion.
You have a Web site, don't you?
---------------------------
OK. I went through the PDF. The one attack you discovered is interesting, and the vuln you discovered should be fixed.
That said...
On page 25, you present the following suggestions (none of which address any of the flaws you discovered) under the section Hardening of AppVMs:
Honestly, I think you have fundamentally misunderstood the design
of Qubes OS, or you are still stuck in the old mental model of the
UNIX security model, and your critiques stem from this
misunderstanding / fixation. If you want to critique a system of
ideas that starts with postulate X, and your critique's
argument starts with "I postulate not-X", then your
argument is not at all critiquing that system.
I'm saying all of the above as someone experienced with Qubes OS, who has written several third-party utilities specifically for the Qubes OS environment — I even wrote a utility to share entire file systems conveniently between VMs, so I did basically what you suggested in point (4). At no point in the development of this utility did it even occur to me "You know what would be a swell idea? To pass these shared files through dom0." That seems to me like an extreme error of judgment.
On page 26, you present the section Hardening of the whole solution:
The section File transfer solution suggests that file
integrity must be checked. You propose no mechanism to do this.
What you propose is to download files to a "secure and inalterable
compartment" — and then what? Leave the data there? How
does the user use the data then? You also propose involving dom0
in said downloaded data flow — which would basically guarantee
compromise of dom0, id est, MS-DOS security. It's like
your mental image of what the Qubes OS security model is, is the
exact opposite of how the Qubes OS security model is implemented.
dom0 never touches untrusted data.
The section Hypervisor and subsequent section dom0 design and update strategy suggest:
Not to say that I don't sympathize with these suggestions. If I had the time, I would probably reimplement Qubes OS atop Genode with the L4 kernel or some other separation kernel.
Finally, on page 30, you present a "qubes trojan"... that requires execution in dom0. That's not a trojan, that's a self-own. If your "trojan" needs to run from the very compartment that the "trojan" is supposed to first break into, then I am not entirely sure what to make of your "trojan".
My rough conclusion is that the vast majority of the paper has little merit / is critiquing something not well understood by the author.
I hope to see the next edition of the paper soon.
You can configure VM to require dom0 confirmation for sudo access, see:
https://www.qubes-os.org/doc/vm-sudo/#replacing-passwordless-root-access-with-dom0-user-prompt
At the top of this page you can also find reasoning why it isn't this
way by default.
if somebody could find and exploit a bug in the Xen hypervisor -- as of 2016, there have been only three publicly disclosed exploitable bugs in the Xen hypervisor from a VM -- then it would be highly unlikely if that person couldn't also found a user-to-root
escalation in VM (which as we know from history of UNIX/Linux happens all the time)."
Generally, if someone gets arbitrary code execution inside a VM (outside
of any application-specific sandbox, if any), then already has access to
most of the stuff that VM has (user data, applications state etc). There
is very little point in guarding root access, as it doesn't give you
much more.
... having individual applications in additional sandboxes, very much
makes sense. That's why we are working on un-breaking SELinux[1], enable
Apparmor in Debian[2], (slowly) migrating to Wayland[3] (as otherwise
X11 gives trivial bypass of a lot of sandboxes) and few more.
Firejail for Firefox makes sense too, although we try to stick with
distributions defaults as much as reasonably possible[4] - we let users
use Fedora/Debian/etc, not QFedora/QDebian/etc (see reasoning at [4]).
But there are exceptions, where we do apply some extra hardening -
for example most of the network/firewall configuration is custom.
Generally, "the qubes way" is to use disposable qubes, but as you
(rightfully) noted, it does require resources and isn't always
convenient. While in-VM sandboxes are useful defense in depth, I'd
rather avoid them being the primary one. Opening a file coming from
untrusted world isolated "just" by Linux-based sandbox is not something
I'd like to rely on.
One of the things we will focus on in short-medium
term is to make VMs (especially disposable ones) lighter - both lower
RAM usage, and make them quicker to start. This will make more
disaggregated setups (like, opening files in disposable qubes by
default) less painful to use.
One recent feature that you may find especially interesting, is
configuring selected applications to open _all_ files in disposable
qubes by default[5]. This a new, experimental thing in Qubes 4.1, and
sadly doesn't work with all the applications yet (especially those using
dbus-activation). Unfortunately GUI[6] for it didn't make it to R4.1,
and the non-GUI method is not documented yet[7]. But the core part is
there.
I'd like to answer to few points of your article directly too:
> The hypervisor domain must NOT be updated/manipulated by the end user (see
> below Dom0 design and update strategy)
Yes, that's very much on the roadmap. Moving GUI outside of dom0[8] is one
of the steps towards this goal. This way, we get rid of the one thing that
users like to customize - desktop environment. And removing this massive
pile of software from dom0 will make it _much_ smaller, which will make
updating as a whole more realistic scenario. Having exactly the same
dom0 fs content everywhere will also allow much stricter integrity
protection, and verification.
No, that's backward. Filesystem-level sharing is rather complex thing,
with a huge attack surface, we definitely don't want to expose dom0 to
such attacks.
When you design your data flow, you (currently, unfortunately) need to
think how do you trust components involved. Making transfer
trusted->untrusted->trusted slightly(*) less risky is not very useful.
If you need such transfer (assuming here you trust the "original"
content of downloaded data), simply use appropriate VM to download the
file. If in doubt, use (fresh) disposable one. If you don't trust the
original content, there are still few things you can do:
- for pdf and images, we have tool to "clean" them up[9]
- for others, you can always open them in disposable qube, including
extracting the data you actually need there (in your very example -
open such tar in a disposable qube, and qvm-copy only the content you
need - and still treat it as untrusted)
You can start by checking https://www.qubes-os.org/doc/contributing/.
Things like wrapping Firefox (and possibly others) with firejail sounds
like a good idea for the start. To keep things nicely organized, IMO it
should be a separate repository (and separate rpm/deb/... package). You
can use for example
https://github.com/QubesOS/qubes-app-linux-snapd-helper as a skeleton.
BTW, your appendix A is rather complex, there are much simpler ways.
Hint: qvm-run --localcmd.
The lack of network in dom0 (and templates)
have two purposes:
1. Make it harder to get _into_ dom0.
2. Avoid _accidental_ untrusted data download (like, your favorite desktop
configuring tool trying to download you a wallpaper from
http://some.random.website/).
If you are in dom0 already, your options are rather limitless. Breaking
naive connect-back shells is rather poor consolation.