by alexlarsson · 11y ago · 0 comments
First of all, X11 is completely unsecure, the "sandboxed" app has full access to every other X11 client. Thus, its very easy to write a simple X app that looks for say a terminal window and injects key events (say using Xtest extension) in it to type whatever it wants. Here is another example that sniffs the key events, including when you unlock the lock screen: https://github.com/magcius/keylog
Secondly, if you have docker access you have root access. You can easily run something like:
docker run -v /:/tmp ubuntu rm -rf /tmp/*
Which will remove all the files on your system.
http://blogs.gnome.org/alexl/2015/02/17/first-fully-sandboxe...
http://www.youtube.com/watch?v=t-2a_XYJPEY
Like Ron Burgundy, he's... "kind of a big deal".
(Suffer the compliments, Alex.)
It does try to keep containers separated but it does not enforce thatthrough a particularly strong mechanism.
Of course, there have been other vulnerabilities in the past allowing containers to get root. And the X11 weakness alone is enough to not treat this as a security layer.
It's kind of like the general distaste for setuid binaries. If you have a correctly-written setuid binary, then you can use it to sandbox a process by, say, running it in a chroot. But if it's not correctly written, you have problems on your hands that far outweigh the problem you were originally trying to solve. So a random desktop app that ships with a setuid helper binary is going to be seen with suspicion. (Chrome is the only one I can think of that ships one, but they probably employ the people most qualified to write a bug-free setuid app, and they're getting rid of it in favor of user namespaces anyway.)
Of course, for the average developer desktop, processes probably have fifteen ways to gain passwordless root anyway. I certainly set sudo to nopasswd for convenience. :) So on a developer desktop, it's a nifty hack, although it doesn't gain you security against a malicious app/exploit. But as a general-purpose sandboxing approach, it's a bad tradeoff to make.
This stuff is only sort-of reliable when-containers-dont-have-root-bug-today if you run that as a separate user than yourself in a different X server
So basically not cool.
The way GNOME is doing ACTUAL sandboxing is much neater. Turns out it doesn't use Docker also. Go figure /sarcasm.
So your "when-containers-dont-have-root-bug-today" applies to Gnome too...
Also: there is no such thing as 'actual' sandboxing. There are many forms of sandboxing, containers (not docker-exclusive, as Gnome is using it exactly the same way) is one form, but we also know Virtual Machines, the Java VM, Javascript in a browser, ... the list goes on - all meaning the same thing: shield an application from everything else on the computer and try to prevent it from breaking out.
Once you have the images running the code in them could easily break out of the container via X11, and do things like sniff all keyboard events and inject events into any app.
Of course, the apps you put in the images probably are not doing that. But people need to be aware that this is not a sandbox they can run untrusted code in.
It's a fun hack, and I think if you said it was a fun hack instead of a security measure you'd have gotten a different reaction. (I agree it's a fun hack! It's just not a security measure.)
This sort of thing is irresponsible without the proper explanation of the dangers involved.
But now. He mentioned a valid security issue and instead of being glad and acknoweledging it you are dismissing it. With security issues that is not cool.
It doesn't help probably that you put "Docker" or "microservices" in the headline it would get upvoted to the top.