Page cover

cloud-checkCVE-2024-21626: runc Container Breakout Vulnerability

Skill Level: Intermediate Time to Read: 8 minutes Category: Container Security / Privilege Escalation CVSS Score: 8.6 (High) Affected: runc ≀ 1.1.11, Docker, containerd, Kubernetes


Overview

On January 31, 2024, a critical vulnerability was disclosed in runc - the container runtime that powers Docker and Kubernetes. This vulnerability allows attackers to escape container sandboxes and gain root access on the host system. For bug bounty hunters targeting cloud and containerized applications, this represents a significant opportunity - and risk.

Why This Matters for Bug Bounty:

  • Affects 90%+ of containerized environments

  • Can turn a low-impact container escape into full host compromise

  • Easy to verify if target is vulnerable

  • Payouts for container escapes typically $2,000-$15,000+


What is CVE-2024-21626?

Technical Summary: The vulnerability exists in how runc handles file descriptors when setting up the container's working directory. By manipulating the /proc/self/fd/ directory, an attacker can trick runc into mounting the host filesystem inside the container.

Attack Vector:

  1. Container starts with a malicious working directory

  2. Working directory contains a symlink to /proc/self/fd/7

  3. runc follows the symlink and opens the host's filesystem

  4. Attacker now has read/write access to host from inside container

Real-World Impact:

  • Access to host's /etc/shadow, SSH keys, cloud credentials

  • Ability to modify host binaries

  • Lateral movement to other containers

  • Complete cluster compromise in Kubernetes


How to Detect It

Method 1: Check runc Version (Passive)

What to look for in bug bounty targets:

  • Server headers mentioning Docker

  • Container orchestration endpoints

  • Cloud-native applications

  • Microservices architectures

Method 2: Exploit Verification (Proof of Concept)

⚠️ WARNING: Only test on systems you own or have explicit permission to test

Method 3: Automated Detection with Nuclei

Run it:


Exploitation in Bug Bounty Context

Scenario 1: Compromised Container β†’ Host Escape

Chain:

  1. Find SSRF or RCE in web app (gets you into container)

  2. Verify runc is vulnerable

  3. Exploit to escape container

  4. Access cloud metadata service

  5. Steal cloud credentials

Commands:

Scenario 2: CI/CD Pipeline Attack

Many CI/CD systems run builds in containers. If you can:

  1. Modify a project's Dockerfile or CI config

  2. Insert malicious WORKDIR

  3. Next build escapes to host

  4. Access build secrets, source code, deployment keys


Prevention Guide

For Developers/DevOps:

Immediate Actions:

Configuration Hardening:

Kubernetes Security:


Real-World Bug Bounty Reports

Report #1: Container Escape to Cloud Takeover

  • Platform: HackerOne

  • Program: Major cloud provider

  • Bounty: $12,500

  • Technique: SSRF β†’ Container β†’ runc escape β†’ IAM role hijacking

  • Timeline: 3 days from report to fix

Report #2: CI/CD Container Breakout

  • Platform: Bugcrowd

  • Program: CI/CD platform

  • Bounty: $8,000

  • Technique: Malicious PR β†’ Container escape β†’ Build secrets theft

  • Impact: Access to production deployment keys

Report #3: Multi-Tenant Isolation Bypass

  • Platform: Intigriti

  • Program: Container hosting service

  • Bounty: $15,000

  • Technique: Cross-container escape via shared runc

  • Impact: Access to other customers' containers


Testing Checklist

Use this when assessing containerized targets:


Pro Tips

πŸ’‘ Tip #1: Quick Version Check If you have command execution in a container, this one-liner checks runc version:

πŸ’‘ Tip #2: Cloud Metadata Check Always check for cloud metadata after escaping:

πŸ’‘ Tip #3: Report Template When reporting, include:

  1. Exact version numbers

  2. Proof of concept (without full exploit)

  3. Impact assessment (what could attacker access?)

  4. Suggested remediation

  5. CVSS score calculation

πŸ’‘ Tip #4: Stay Updated Container vulnerabilities are frequent. Subscribe to:

  • Open Container Initiative (OCI) security advisories

  • Docker Security Announcements

  • Kubernetes Security Committee notifications


Resources

Official Sources

Tools

Practice Labs


Summary

CVE-2024-21626 represents a critical vulnerability affecting virtually all containerized environments. For bug bounty hunters, it provides both an opportunity (finding vulnerable targets) and a reminder (container escapes can have massive impact).

Key Takeaways:

  • Check runc version in containerized targets

  • Container escape often leads to full cloud compromise

  • Report impact, not just the technical vulnerability

  • Stay current with container runtime security

Next Steps:

  1. Audit your current bug bounty targets for containers

  2. Add container escape checks to your methodology

  3. Practice in safe environments before testing real targets

  4. Report responsibly with clear impact statements


Was this helpful? [Yes] [No] Questions? Drop them in our Telegram communityarrow-up-right

Last updated