10 ms·
Linux sandboxing improvements in Firefox 60
- shakna 9y ago> The most important change is that content processes — which render Web pages and execute JavaScript — are no longer allowed to directly connect to the Internet, or connect to most local services accessed with Unix-domain sockets (for example, PulseAudio). Finally, some process isolation! That's something to celebrate! Being able to wrap Firefox in an unprivileged chroot makes for a really nice addition to its security.
- xnyanta 9y agoThat's pretty nice to see. If I am not mistaken, Tor Browser has already been using this technique for some time to thwart malicious connections from leaving the browser. All traffic is communicated to the tor client via a unix socket.
- IronBacon 9y ago>if the browser has been set up to use a proxy server, connecting directly to the internet is no longer possible. I haven't followed the development, would this also prevent WebRTC IP address leakage? Here IIRC I've simply disable it (media.peerconnection.enabled) and forgot about it...
- chupasaurus 9y agoI'm running browser inside network namespace with VPN tun device, so the only address it could leak is a tunnel one.
- CapacitorSet 9y agoCare to explain how to do that?
- heinrich5991 9y agohttps://www.synkretie.net/writings/easy%20namespaced%20openvpn.html https://www.synkretie.net/writings/easy%20namespaced%20openv... I used that one to route all of my GMail stuff over my server. This is done transparently to Thunderbird, by launching it in its own network namespace. That way, I don't get these annoying "Someone has your password" messages when travelling.
- chupasaurus 9y agoThat's close to what I'm using (I have only one route-script for OpenVPN which is pretty much the same, but handles both up and down commands from VPN client). To make DNS work properly, there should be a resolv.conf file in /etc/netns/$netns_name/ (directory has to be created manually). I should generalize my stuff and push it to Github...
- chupasaurus 9y agoFound a repo [0] with better solution than mine. [0] https://github.com/slingamn/namespaced-openvpn https://github.com/slingamn/namespaced-openvpn
- tonetheman 9y agoYeah I would love to know how you set that up.
- mindslight 9y agoWe're all running some bespoke setup, and probably each planning something more-advanced and more-bespoke, just to overcome bugs in browser implementations. What we all actually need is a browser developed with the goal of being secure by default, rather than shrugging off eg the leaking of network config / window size / rendering engine nondeterminism / etc.
- severine 9y agoPrevious discussion: Linux sandboxing improvements in Firefox 57 (morbo.org) 276 points, 6 months ago, 103 comments https://news.ycombinator.com/item?id=15678492 https://news.ycombinator.com/item?id=15678492
- zaphirplane 9y agoI wounder what sandboxing improvement will be in 63 ;)
- severine 9y agohttps://wiki.mozilla.org/Security/Sandbox#Priorities https://wiki.mozilla.org/Security/Sandbox#Priorities
- d33 9y agoInteresting. Sandboxing in Chrome is something I turn off when I write my headless bots as it requires extra privileges. Would be nice to see a comparison between it and FF.
- staticassertion 9y agoCan you elaborate?
- deleted 9y ago[deleted]
- icebraining 9y agoI'm guessing d33 is talking about the capabilities needed to setup the sandbox (like CAP_SYS_CHROOT), as mentioned in the article.
- jbroman 9y agoIf you're on Linux >= 3.10, I believe Chrome should use the namespaces sandbox rather than the (privileged) setuid sandbox. https://chromium.googlesource.com/chromium/src/+/master/docs/linux_sandboxing.md https://chromium.googlesource.com/chromium/src/+/master/docs...
- the8472 9y ago> In this context, we'd like to remark that an application like Firefox only needs CAP_SYS_ADMIN, CAP_SYS_CHROOT, CAP_SET(UG)ID to achieve most effect I hope they also drop those capabilities once they have achieved what they need. I also which other namespaces they use, the article only mentions user namespaces.
- tialaramex 9y agoCAP_SYS_ADMIN is a catch-all where they dump all the things root has that didn't fall into another bucket. So if a program needs CAP_SYS_ADMIN then basically you haven't really got any meaningful sandboxing so far as I understand it.
- tux3 9y agoOutside a namespace, CAP_SYS_ADMIN is enough to grant yourself any other capability, but inside a namespace the main danger is that it exposes a bit more kernel attack surface than a normal user would have. The important question is whether the APIs that CAP_SYS_ADMIN and other capabiloities grants you access to are potential security issues in an user namespace. Dropping things like CAP_NET_ADMIN in a namespace is useful, because helps reduce the attack surface further.
- usr1106 9y agoRight, CAP_SYS_ADMIN has been described as the new root. It gives the sandbox more rights than what a normal user process would have. Well, capability checks are often carried out against a resource. Their namespace does probably not own many resources. So I would like to see a detailed analysis what doors CAP_SYS_ADMIN really opens. But I am very skeptical that this the right thing to do. I wonder why they need CAP_SYS_ADMIN. I have used unprivilegded containers before. We needed to make some ugly compromises to have them do useful work, but CAP_SYS_ADMIN has never been required.
- devit 9y ago> The one exception to the network policy, for now, is the X11 protocol which is used to display graphics and receive keyboard/mouse input Well, this makes everything else moot, since you can just inject keystrokes and thus trivially take over the system... (in addition to probably many other vulnerabilities in the X11 server) They should try to do a proper isolation job (meaning no I/O other than shared memory and pipes to another Firefox process), not this apparently useless effort.
- icebraining 9y agoThe keyword is "for now".
- upofadown 9y ago>since you can just inject keystrokes and thus trivially take over the system... From javascript in a browser? That would indeed be a serious issue. How would this work exactly?
- makomk 9y agoThe whole point of this is to stop attackers who've managed to break out of the JavaScript sandbox. It's an extra layer of protection. If you're going to assume that an attacker is restricted to what JavaScript is meant to be able to do then the whole exercise is pretty much pointless; this is also a bad assumption.
- db48x 9y agoIf you have 10 problems to fix, the effort spent fixing the first 9 of them isn't "useless" as you say, just because you haven't fixed the 10th one yet. And they couldn't fix all of the issues by blindly proxying all IO through the main Firefox process, either, because that wouldn't fix the problem. It has to be able to _selectively_ proxy IO through the main process, and that takes time and effort to implement.
- jpetso 9y agoWayland to the rescue!
- 9y ago
- owaislone 9y agoNice. Waiting for them to publish 60 to the Snap store now.
- kalmar 9y agoI'm curious why chroot is used instead of mount namespace and pivot_root(2). This would let them get away without CAP_SYS_CHROOT, while also providing stronger filesystem isolation.
- snvzz 9y ago>Unprivileged user namespaces had some security bugs in their initial Linux implementation, and some Linux distribution maintainers are still wary of keeping them enabled. Unsurprising. These are all a pile of hacks to try and fail at making up for the fact Linux doesn't support capabilities (not to be confused with POSIX Capabilities). Fortunately, projects such as seL4 and Genode do exist, so it might be possible to, at some point, run a browser on an actually sane environment.
- ajross 9y agoYou're going to need to be more specific. Linux does indeed have a feature called "capabilities", so it's not clear exactly which OS feature you are taking about.
- snvzz 9y agoLinux Capabilities are POSIX Capabilities, which are a very different thing, with a quite misleading name. From the wikipedia capabilities article[1]: >Capabilities as discussed in this article should not be confused with POSIX 1e/2c "Capabilities". Also refer to the Genode Foundations[2] book, chapter 3.1. [1] https://en.wikipedia.org/wiki/Capability-based_security https://en.wikipedia.org/wiki/Capability-based_security [2] https://genode.org/documentation/genode-foundations-17-05.pdf https://genode.org/documentation/genode-foundations-17-05.pd...
- DyslexicAtheist 9y agoI second that. Genode isolation of concerns is absolutely beautiful.
- AnIdiotOnTheNet 9y agoI eagerly await the day some non-Linux kernel manages to achieve anywhere near the driver support Linux has.
- conradev 9y ago
- neolefty 9y agoAre these improvements applicable to Android?
- canuckistani 9y agoNo.
- rebelwebmaster 9y agoProbably not since Firefox for Android doesn't support multiprocess.
- app4soft 9y agoMore sandboxing![0] $ firejail --appimage Firefox-*.AppImage For details read Firejail's docs.[1, 2] [0] https://twitter.com/app4soft/status/994938745072832512 https://twitter.com/app4soft/status/994938745072832512 [1] https://firejail.wordpress.com/documentation-2/appimage-support/ https://firejail.wordpress.com/documentation-2/appimage-supp... [2] https://firejail.wordpress.com/documentation-2/firefox-guide/ https://firejail.wordpress.com/documentation-2/firefox-guide...
- miduil 9y agoLast year, afer a firejail local root exploit got released [0], I've completely quit following their project. I don't want to discomfort the developers and I think it's stunning what they are creating... But under the aspect that they are working on a security product, I'm concerned by their overall code quality and testing strategy. They might want to consider taking a step back and reevaluating how they are going to direct their development in terms of secure (c-)coding practices. *Disclaimer: Not a developer, just a sysadmin, but reviewing some of their code/profiles/CI-jobs in their git repo [1] leaves a bad feeling. [0]: https://www.exploit-db.com/exploits/43359/ https://www.exploit-db.com/exploits/43359/ [1]: https://github.com/netblue30/firejail/tree/6830065197cc574898850bb7f2b2f5b214505704 https://github.com/netblue30/firejail/tree/6830065197cc57489...
- _emacsomancer_ 9y agoI have much the same story/experience. Do you use something else in place of firejail?
- miduil 9y agoNo, I'm still one part of the please don't hack me fraction - still I'm avoiding solution that might improve the security (when seen as layers) a bit. I suppose one should use https://www.qubes-os.org/ https://www.qubes-os.org/.
- _emacsomancer_ 9y ago
- shmerl 9y ago> Specifically, we use Linux namespaces and chroot. Would apparmor be a better solution?
- sp332 9y agoAppArmor isn't available on all distros - Fedora, for example. I think it's left up to the distro maintainer to set up AppArmor profiles.
- civodul 9y agoNice to see this happen! In a similar vein, in Guix we've been discussing ways to run any installed program in its own namespaces, with only the appropriate resources mapped into them: https://lists.gnu.org/archive/html/help-guix/2018-01/msg00056.html https://lists.gnu.org/archive/html/help-guix/2018-01/msg0005... . User namespaces slowly but surely help retrofit the "principle of least privilege" to GNU/Linux, and that is good.
- esaym 9y agoAnd if WebGl no longer works, try setting (in about:config) security.sandbox.content.read_path_whitelist to /sys/class/drm/card0/device/config,/sys/class/drm/renderD128/device/config,/sys/class/drm/controlD64/device/config
- 8bitsrule 9y agoI don't know much about this topic, and appreciate sane levels of protection. But when I use the menu in Snap Firefox (59) to open a file in another partition so I can read it ... and I can't do that because of 'permissions' ... I get irritated. While I'm on this general topic ... I also don't like the fact that javascript won't let me write to a file. That would be VERY USEFUL. In short, these long-term accumulation of these 'hardwired' restrictions is severely cramping my use of (and enjoyment of using) computers. If I want it, I have time to change a preference, but not to earn a PhD.
- tracker1 9y agoJavascript can write to a file.. see jsshell, node and a number of other runtimes. However, you do not want browsers to have unfettered filesystem access. The language is perfectly able. You could possibly write an extension to do what you want.
- 8bitsrule 9y agoI'm not talking about 'unfettered'. It would be great for me to -natively- let users write-to/modify text-only files in the same folder as the parent file. I fail to understand why this has to be hard, dangerous (it'd certainly be useful ... to them AND to me). Real languages have a WRITE command. FileReader was a big step forward that took forever to arrive. Where's FileWriter?
- tracker1 9y agoHere's more info... https://stackoverflow.com/a/2158074 https://stackoverflow.com/a/2158074
- 8bitsrule 9y agoThanks for that, but I'm talking about user-initiated writing to separate, editable, plaintext, named files in the same local folder as the parent HTML/JS source. NO web interaction needed or desired, no other knowledge of or access to filesystem desired. For example, browser as IDE. Or database editor/searcher. Powered by JS.