User namespaces let a container's root be an unprivileged user on the host, which is what makes rootless containers safer. Running without one (userns=host, the default for rootful Docker and most Kubernetes pods) means container UID 0 is host UID 0, so capabilities and file access apply with full force against host resources. It is less a standalone escape than the precondition that makes the others work.
cat /proc/self/uid_map
# 0 0 4294967295 => no mapping, container root IS host root
# 0 100000 65536 => mapped, container root is an unprivileged host user
Exploitation notes#
- A
uid_mapof0 0 ...is the signal: every capability-based escape (Capability abuse) and every host-file write acts as real root. - Under a real user-namespace mapping, the same capabilities are confined to the mapped range, so many escapes fail or are limited to the namespace.
- When a mapping is present, look instead for mapping overlaps or a shared
/proc//systhat crosses it.