Containers give you isolation, not virtualization. Confuse the two and a web-container command injection becomes full host root.
Containers do not provide virtualization. They provide isolation . Treat isolation as a hard security boundary and a low-privilege injection inside a web container can become root on the host .
One of the most battle-tested tools for finding these misconfigs is dockerscan by cr0hn:
https://github.com/cr0hn/dockerscan
Three misconfigurations cause most container breaches.
1. The exposed Docker socket
Teams mount the host socket into a container as a Docker-in-Docker shortcut:
# catastrophic: volumes : - /var/run/docker.sock:/var/run/docker.sock
Enter fullscreen mode
Exit fullscreen mode
Write access to the socket is root on the host β no kernel exploit needed:
docker run -v /:/host -it alpine chroot /host
Enter fullscreen mode
Exit fullscreen mode
That mounts the entire host filesystem and drops you into a root shell.
2.β¦