runc vulnerabilities
3 real-world CVEs in runc. Each one is a short hands-on exercise in Hexret: find the vulnerable line, follow the exploit and learn the fix.
- CVE-2024-21626high 8.62024
Leaky Vessels: runc leaked-fd working-directory container escape (CVE-2024-21626)
runc marks stray inherited file descriptors close-on-exec but then enters the workload's requested working directory before they are actually closed, so a cwd of /proc/self/fd/N re-enters a still-open host directory handle and the process escapes onto the host filesystem.
- CVE-2021-30465high 8.52021
runc mount-destination symlink race (container escape)
A bind-mount destination is resolved and confined once, then the mount syscall re-walks it as a string, so a racing symlink swap redirects the mount outside the container and bind-mounts the host filesystem in.
- CVE-2019-5736high 8.62019
runc container escape via /proc/self/exe
A container runtime re-executes its own on-disk binary through /proc/self/exe to enter the sandbox, so code running in the sandbox can grab a writable handle to that binary and overwrite it, taking over the host.