Privilege Escalation via Docker
Membership of the 'docker' group lets a user talk to the Docker daemon, which runs as root. An attacker with such an account could start a container that mounts the host root filesystem and obtain a root shell.
fosterelli.co
Published on fosterelli.co
Docker, if you aren’t already familiar with it, is a lightweight runtime and packaging tool. It’s very similar to simply running a basic virtual machine, but with much less overhead.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The Docker daemon runs as root and grants full control to any member of the 'docker' group, so group membership is equivalent to root access.
Impact
A user in the 'docker' group could gain full root control of the host machine.
What the attacker needed
Access to an account in the 'docker' group
The fix
The author advises never using the 'docker' group and says the documentation should make its root-equivalent nature clearer; Docker is aware but has no intention of fixing it.
How it was found
- Obtain access to a user account that is a member of the 'docker' group.
- Run a Docker command that starts a container with a volume mounted from the host root filesystem.
- The container loads a chroot into that volume, giving a root shell on the host.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Docker is a tool for running programs in isolated boxes called containers. The background service that manages containers runs with the highest level of permission on the machine. If an ordinary user is allowed to send commands to that service, they can ask it to start a container that exposes the whole machine's files, which effectively makes them the administrator.
What is Misconfiguration?
Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.