Live data from Hacker News

Nerd Sniped by BINFMT_MISC

blog.jessfraz.com

11–20 of 36 posts

Re: Nerd Sniped by BINFMT_MISC

#11
The equiv command in Microsoft Windows is "assoc". You can run it with no args to see what programs are associated with what extensions in Windows. I mention this because of a security concern.

i.e.

    assoc

    assoc .vbs=txtfile
    assoc .mp4=WMP11.AssocFile.MP4
Perhaps it may be worth considering security practices for BINFMT_MISC before people find any sub-optimal defaults. In the past, clever people would exploit some of the default associations that applications would insert on Windows desktops. At some point, desktop file exploring apps may decide to hide "known extensions. The desktop will also leverage this association.

Re: Nerd Sniped by BINFMT_MISC

#12

Earlier quoted context omitted.

Containers aren’t VMs. There’s no VM to escape, and Xen has nothing whatsoever to do with containers. Ironically, there’s a really good explanation of this topic which was given by the author at a conference. Also, this is a write-up about something cool that author discovered. It’s about the fact that dot slash isn’t magic, but rather a feature which can be (ab)used to do something out of the ordinary. Sounds like a…

An excellent and helpful correction. But security-wise chroot/runc is even worse than Xen, since the attack surface is so much bigger! https://nvd.nist.gov/vuln/search/results?adv_search=false&fo... https://nvd.nist.gov/vuln/search/results?adv_search=false&fo...

This doesn't use docker or a chroot, it's a pivot root.

Re: Nerd Sniped by BINFMT_MISC

#13

Earlier quoted context omitted.

Containers aren’t VMs. There’s no VM to escape, and Xen has nothing whatsoever to do with containers. Ironically, there’s a really good explanation of this topic which was given by the author at a conference. Also, this is a write-up about something cool that author discovered. It’s about the fact that dot slash isn’t magic, but rather a feature which can be (ab)used to do something out of the ordinary. Sounds like a…

An excellent and helpful correction. But security-wise chroot/runc is even worse than Xen, since the attack surface is so much bigger! https://nvd.nist.gov/vuln/search/results?adv_search=false&fo... https://nvd.nist.gov/vuln/search/results?adv_search=false&fo...

See first comment about how it's a pivot root and if you are going to claim containers are insecure please first capture the flag on https://contained.af or gfy

Re: Nerd Sniped by BINFMT_MISC

#14

Earlier quoted context omitted.

Containers aren’t VMs. There’s no VM to escape, and Xen has nothing whatsoever to do with containers. Ironically, there’s a really good explanation of this topic which was given by the author at a conference. Also, this is a write-up about something cool that author discovered. It’s about the fact that dot slash isn’t magic, but rather a feature which can be (ab)used to do something out of the ordinary. Sounds like a…

An excellent and helpful correction. But security-wise chroot/runc is even worse than Xen, since the attack surface is so much bigger! https://nvd.nist.gov/vuln/search/results?adv_search=false&fo... https://nvd.nist.gov/vuln/search/results?adv_search=false&fo...

tl;dr Docker != runc. runc has only had one known partial container breakout that required host coordination, and all of the runc CVEs are useless in rootless containers (which is what jessfraz is using).

Of the vulnerabilities you've listed (while searching "docker") only four were actually runc vulnerabilities, and most required you to be running root inside the container (or required you to have some form of privileged access on the host). Also, runc doesn't use chroot -- we use pivot_root.

You've also just done a full-text search for "docker" and several of the CVEs just have the word and are not actually vulnerabilities in "docker" nor runc. I don't understand what this is meant to show.

In particular, these are the only vulnerabilities in that list that are arguably related to your point.

* CVE-2017-16539 -- a default configuration error allowing a DoS if you're root in a non-user-namespaced container. The PoC in TFA uses user namespaces and thus this attack is pointless. Not to mention you shouldn't run as root anyway, please stop doing that.

* CVE-2016-9962 -- a partial container escape if you have another process joining the container, there were also several kernel bugs found as well as a result. Also requires root, and user namespaces had a fix for this in the next kernel version. Again, stop running stuff as root.

* CVE-2015-3627 -- an information disclosure that requires a malicious rootfs (so you have to have host-side coordination to set up the rootfs before the container starts), and was never present in "runc" just the library that predated it.

* CVE-2015-3629 -- a partial container escape that required significant host-side coordination (you have to change the configuration of the container to be malicious). Also wasn't present in "runc" just the library that predated it.

So, there has only ever been one plausible container breakout in runc to-date and it was CVE-2016-9962 (and it still required using bad practices). You could argue that CVE-2016-3697 was also a runc bug, but that code was only used by Docker at the time (more of a library bug than a container breakout bug). CVE-2015-3629 requires you to effectively create the container that you're going to break out of, so not viable from a "bad code in a container" perspective.

I'm not excusing these bugs, but they should be put in context. CVEs have CVSS scores for a reason -- they are not all created equal and you need to look at each one individually before coming to conclusions.

I do respect the folks who work on Xen, don't get me wrong, but I don't understand this argument for the security of Xen. If I only consider the 11-year-old floppy privilege escalation[1], then runc is already on better footing in terms of "which project had a worse example of a vulnerability resulting in containment escape". Whether this is due to the young age of containers on Linux, or because containers levarage many different security features, I'm not sure.

Source: I'm a maintainer of runc, and I found CVE-2016-9962.

[1]: https://xenbits.xen.org/xsa/advisory-133.html

Re: Nerd Sniped by BINFMT_MISC

#15

The equiv command in Microsoft Windows is "assoc". You can run it with no args to see what programs are associated with what extensions in Windows. I mention this because of a security concern. i.e. assoc assoc .vbs=txtfile assoc .mp4=WMP11.AssocFile.MP4 Perhaps it may be worth considering security practices for BINFMT_MISC before people find any sub-optimal defaults. In the past, clever people would exploit some of…

You need to be root to change binfmt_misc's configuration, so it's not analgous to Windows' file associations (which the user can also change).

I also believe that xdg-open (and the XDG scheme) is more similar to Windows' file associations than binfmt_misc, since XDG is more of a user-facing thing.

Re: Nerd Sniped by BINFMT_MISC

#16
post #9
post #2

> Hacker news, you can shove your comments right up your ...

Maybe it's because this place tends to be quite negative if you don't confirm to a very specific set of norms.

In my observation those "norms" are always in the eye of the beholder, and people have very contradictory notions of what they supposedly are.

Re: Nerd Sniped by BINFMT_MISC

#18
Too bad the more narrow minded segment of the HN population appears to have buried this one out of spite.. because this is some super pro badass shit, packaged in a hilarious format by jessfraz. Guess it's not everyone's kind of humor, a real tradgedy if you ask me.

Can you imagine a future where you don't have to install runtimes to run things anymore because they are all distributed with everything you need? It would be amazing and magical in many ways. No more reinstalling the OS because things got weird after X went berserk.

Being forced to pollute my perfect, pristine machines with multiple versions of Python, or having to even commit to a single version of anything seems less good than not having to.

I'd rather burn the extra HDD space to avoid risky installs messing up the system.

Re: Nerd Sniped by BINFMT_MISC

#19
post #2

> Hacker news, you can shove your comments right up your ...

Yes, very odd. Don't think I'll be upvoting this submission. >Imagine if an entire OS had all the languages packaged this way so that everything could be “dot slashed” and executed but without actually installing the language to your host operating system. This has been technically possible for decades, but the disadvantages (startup time, memory use, disk use) outweigh the advantages. (better security, assuming no V…

I think you could've just as easily stated. "Huh interesting what are the downsides?"

Suppose that would admit not knowing something... certainly not something we should be encouraging!

Re: Nerd Sniped by BINFMT_MISC

#20
post #15

The equiv command in Microsoft Windows is "assoc". You can run it with no args to see what programs are associated with what extensions in Windows. I mention this because of a security concern. i.e. assoc assoc .vbs=txtfile assoc .mp4=WMP11.AssocFile.MP4 Perhaps it may be worth considering security practices for BINFMT_MISC before people find any sub-optimal defaults. In the past, clever people would exploit some of…

You need to be root to change binfmt_misc's configuration, so it's not analgous to Windows' file associations (which the user can also change). I also believe that xdg-open (and the XDG scheme) is more similar to Windows' file associations than binfmt_misc, since XDG is more of a user-facing thing.

I believe you need to be a on an admin account in Windows to change global file associations. In fairness though, most people are logged in as an Administrator.
Post reply on HN