Skip to main content
Mallory
HighPublic exploit

runC container escape via /proc/self/exe overwrite

IdentifiersCVE-2019-5736CWE-404

CVE-2019-5736 is a container escape vulnerability in runC through 1.0-rc6, affecting Docker before 18.09.2 and other products that use the OCI runC runtime. The flaw is caused by improper handling of file descriptors associated with /proc/self/exe during container process execution. In vulnerable flows, runC can be tricked into executing or exposing the host runC binary in a way that allows a process running as root inside a container to overwrite that host binary. Documented exploitation paths include launching a new container from an attacker-controlled image or attaching to an existing attacker-modified container via docker exec. Public analyses describe abuse of procfs semantics around /proc/self/exe and /proc/[pid]/exe, including cases where runC re-executes itself and inherited file descriptors can later be reopened for writing. Once the host runC binary is replaced with attacker-controlled content, the next invocation of runC executes attacker code on the host as root.

Share:
For your environment

Are you exposed to this one?

Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.

ANALYST BRIEF

Impact, mitigation & remediation

What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation results in container escape and host compromise. An attacker can overwrite the host's runC binary and obtain arbitrary code execution with root privileges on the underlying host. This can lead to full node takeover, access to other containers and workloads on the host, theft of secrets, lateral movement, persistence through runtime replacement, and broader cluster compromise in orchestrated environments.

Mitigation

If you can’t patch tonight, do this now.

If immediate patching is not possible, reduce exposure by avoiding execution of untrusted container images, restricting who can start containers or run docker exec against existing containers, and minimizing opportunities for attackers to obtain root inside containers. User namespaces mitigate this issue because container root maps to an unprivileged host user and cannot write the host runC binary; enabling user-namespace remapping where supported reduces risk. Additional defensive measures include running containers as non-root where feasible, limiting write access inside containers, restricting access to container management interfaces, and avoiding privileged LXC containers, which are specifically noted as vulnerable.

Remediation

Patch, then assume compromise.

Upgrade runC to a fixed release and update dependent platforms to vendor-patched versions. The provided content states the issue affects runC through 1.0-rc6 and Docker before 18.09.2; Docker installations should be upgraded to 18.09.2 or later, and other affected products should be updated to versions that include the runC fix. The documented fix re-executes from a sealed anonymous in-memory copy created with memfd_create(), preventing overwrite of the on-disk host binary from inside the container. Where vendor advisories apply, deploy the patched AMIs, platform versions, or product releases and replace existing nodes/instances/tasks so the fixed runtime is actually in use.
PUBLIC EXPLOITS

Exploits

8 valid exploits after Mallory filtered fakes, detection scripts, and README-only repos (3 hidden).

VALID 8 / 11 TOTALView more in app
CVE-2026-31431-Container-EscapeMaturityPoCVerified exploit

Repository is a small Linux-focused exploit PoC with two functional files: main.go and runC.sh. main.go is a standalone Go exploit that embeds a compressed binary payload and writes it into a target executable using Linux AF_ALG sockets, ancillary control messages, and splice-based file descriptor operations. The overwrite occurs in 4-byte chunks, suggesting it is implementing a kernel/file-descriptor abuse primitive rather than a normal file write. The code defaults to targeting /usr/bin/su and can optionally execute su after the overwrite. Error handling explicitly treats aborted AF_ALG requests as a sign of a patched or mitigated kernel. runC.sh provides the container-escape orchestration. It overwrites /bin/sh with a shebang pointing to /proc/self/exe, then waits in a loop for a process matching /proc/self/exe to appear, identifying a runC process ID. Once found, it invokes /exploit against /proc/<pid>/exe, attempting to overwrite the host-side runC binary while it is executing. This is conceptually similar to the classic runC overwrite/escape technique referenced in the script comments (CVE-2019-5736), but the repository labels the exploit as CVE-2026-31431 and the Go code appears to rely on a vulnerable Linux kernel AF_ALG behavior to perform the overwrite primitive. Overall purpose: provide an operational container-escape exploit chain for Linux environments. The Go component supplies the binary-overwrite primitive and embedded payload; the shell script adapts it to a runC container breakout scenario by locating the runtime process and targeting /proc/<pid>/exe. No network communication is present; the exploit is entirely local/container-based and interacts with Linux file paths, process paths under /proc, and kernel crypto socket interfaces.

qi4LDisclosed May 2, 2026gobashlocalcontainer
cve_2019-5736-PoCMaturityPoCVerified exploit

This repository is a C-based proof-of-concept exploit for CVE-2019-5736, a critical container escape vulnerability in Docker's runc runtime. The exploit is designed to be run from within a malicious Docker container. It works by overwriting the host's runc binary via a race condition, allowing arbitrary command execution as root on the host. The default payload copies the host's /etc/shadow file to /tmp/pwned and makes it world-readable, but the payload can be customized via command-line arguments. The repository includes scripts for setting up a vulnerable Docker environment, building the exploit, and automating the exploitation process. The main exploit logic is implemented in C (src/main.c and src/exploit.c), with supporting headers and build scripts. The exploit targets Linux systems running Docker 18.09.1 and runc, specifically on Ubuntu 18.04.1 as tested. Key fingerprintable endpoints include /bin/sh (overwritten), /proc/self/exe (used for redirection), /etc/shadow (exfiltrated), and /usr/bin/runc (the main target). The exploit is a functional PoC and not weaponized, but demonstrates full host compromise from a container context.

PerimoraDisclosed Jun 25, 2025cbashcontainer escape
CVE-2019-5736MaturityPoCVerified exploit

This repository contains a Go implementation of an exploit for CVE-2019-5736, a critical container escape vulnerability in runc, the default container runtime for Docker and other container systems. The exploit works by overwriting the /bin/sh binary inside a container to point to /proc/self/exe, then locating the runc process on the host and overwriting its binary via the /proc filesystem. The default payload is a bash reverse shell that connects to the attacker's machine (10.10.14.12) on port 1234. The README provides detailed instructions for setting up the exploit, including modifying the payload, compiling the Go code, hosting the binary for download, and orchestrating the attack using multiple terminals. The exploit requires the attacker to have code execution inside a container and is effective against vulnerable runc versions on Linux. The main exploit logic is in main.go, which is the only code file. The repository is operational and provides a working exploit with a customizable payload.

h3x0v3rl0rdDisclosed Jul 8, 2021gomarkdowncontainer escape
CVE-2019-5736-PoCMaturityPoCVerified exploit

This repository is a Proof-of-Concept (PoC) exploit for CVE-2019-5736, a critical container escape vulnerability affecting Docker's runc runtime on Linux. The exploit is implemented in Go (main.go) and is designed to be executed from within a Docker container where the attacker has root privileges. The exploit works by overwriting the /bin/sh binary in the container to point to /proc/self/exe, then locating the runc process on the host, obtaining a file handle to its binary, and overwriting it with a malicious payload. This payload is a shell script that executes arbitrary commands as root on the host when triggered (typically when a user attaches to the container with 'docker exec'). The README.md provides detailed background, usage instructions, and warnings about the destructive nature of the exploit (overwriting runc disables Docker on the host until runc is restored). The exploit targets Docker versions 18.09.1-ce and 18.03.1-ce on Linux distributions such as Ubuntu 18.04, Debian 9, and Arch Linux. The main attack vector is local privilege escalation from within a container to root on the host. The repository contains no network endpoints, but several critical file paths are used as part of the exploit chain.

FrichettenDisclosed Feb 13, 2019golocal
CVE-2019-5736-POCMaturityPoCVerified exploit

This repository is a proof-of-concept exploit for CVE-2019-5736, a critical container escape vulnerability in Docker's runC. The exploit consists of several components: - A Dockerfile that builds a malicious container image, modifies libseccomp, compiles a C binary (overwrite_runc), and adds a malicious bash script (new_runc). - 'overwrite_runc.c' is a C program that, when executed, overwrites the runC binary on the host with the attacker's payload ('new_runc'). - 'run_at_link.c' is appended to libseccomp and is used to trigger the overwrite process by executing 'overwrite_runc' with a file descriptor to the runC binary. - 'new_runc' is a bash script that, once runC is replaced and executed on the host, installs a desktop environment and VNC server, sets up a default password, and configures the VNC server as a persistent systemd service, granting the attacker remote desktop access to the host. The exploit demonstrates a full container escape, allowing arbitrary code execution on the host and persistent access via VNC. The main attack vector is a container escape via a vulnerable runC binary. The repository is well-structured for operational exploitation and is not just a detection script or a simple proof of concept.

RyanNgWHDisclosed Jun 30, 2019cbashcontainer escape
CVE-2019-5736MaturityPoCVerified exploit

This repository contains a working exploit for CVE-2019-5736, a critical container escape vulnerability affecting Docker's runc and LXC on Linux. The exploit allows an attacker with code execution inside a container to overwrite the host's runc binary (or LXC equivalent), leading to root-level code execution on the host. The repository is organized into two main exploit implementations: 1. The 'CVE-2019-5736' directory contains a PoC that uses a malicious shared library and shell script to overwrite the runc binary when a container is started or attached. Key files include 'bad_libseccomp.c' (malicious shared library), 'bad_init.sh' (script to overwrite the binary), and 'make.sh' (build and setup script). 2. The root directory contains a more direct exploit: 'exploit.c' (main exploit logic), 'payload.c' (reverse shell payload), and 'pwn.sh' (automation script to trigger the exploit repeatedly). The payload is a reverse shell connecting to 127.0.0.1:4455 by default, but this can be changed in 'payload.c'. The exploit works by overwriting the host's runc binary (typically /usr/bin/docker-runc) with a malicious script or binary, so that subsequent container operations by the host will execute attacker-controlled code as root. The exploit is operational and includes a working payload, but is not weaponized for mass exploitation. The repository also includes documentation and references to the original vulnerability research.

jas502nDisclosed Feb 14, 2019cbashcontainer escape
RunC-CVE-2019-5736MaturityPoCVerified exploit

This repository provides two proof-of-concept exploits for CVE-2019-5736, a critical vulnerability in runc, the container runtime used by Docker and other container systems. The repository is organized into two main PoCs: 1. exec_POC: Demonstrates the ability to overwrite the runc binary on the host with a benign payload (a program that prints a message). It uses a combination of shell scripts and C code to locate the runc process and replace the binary via /proc filesystem tricks. 2. malicious_image_POC: Demonstrates a more weaponized scenario where the runc binary is replaced with a bash script that opens a reverse shell to 0.0.0.0:2345, allowing remote code execution on the host. This PoC involves modifying libseccomp, compiling a custom overwrite tool, and using a crafted entrypoint to trigger the exploit. Key files include C source code for the overwrite logic, bash scripts for orchestration, Dockerfiles for building the PoC images, and payloads for the runc replacement. The exploit targets Linux systems running vulnerable versions of runc and requires the ability to run a container with a malicious image or code. The main attack vector is through container escape, leading to host compromise by overwriting the runc binary with attacker-controlled code.

twistlockDisclosed Feb 20, 2019cbashcontainer
cve-2019-5736-pocMaturityPoCVerified exploit

This repository is a proof-of-concept exploit for CVE-2019-5736, a critical container escape vulnerability in Docker's runc. The exploit is implemented in two C files (stage1.c and stage2.c) and orchestrated via a Dockerfile. The Dockerfile builds a container that, when run, appends a string to the host's runc binary by exploiting the way runc handles /proc/self/exe. The exploit works by injecting code into the runc binary from within a container, demonstrating the ability to overwrite files on the host. The payload is currently a simple string, but the README notes that arbitrary payloads can be used by modifying stage2.c. The repository is structured for easy demonstration and testing of the vulnerability, and does not include weaponized payloads by default.

q3kDisclosed Feb 12, 2019cdockerfilecontainer escape
EXPOSURE SURFACE

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
Apache Software FoundationMesosapplication
CanonicalUbuntu Linuxapplication
D2iqDc/Osoperating_system
D2iqKubernetes Engineapplication
DockerDockerapplication
Fedora ProjectFedoraoperating_system
GoogleKubernetes Engineapplication
Hewlett Packard EnterpriseOnesphereapplication
Linux FoundationRuncapplication
LinuxcontainersLxcapplication
Micro FocusService Management Automationapplication
NetAppHci Management Nodeapplication
NetAppSolidfireapplication
OpensuseBackports Sleapplication
OpensuseLeapoperating_system
Red HatContainer Development Kitapplication
Red HatEnterprise Linuxoperating_system
Red HatEnterprise Linux Serveroperating_system
Red HatOpenshiftapplication

Vendor-confirmed product mapping. Mallory continuously reconciles this list against your asset inventory.

What this page doesn’t show

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, which detections to deploy, and what to do tonight.
Exposure mapping

Query your assets running an affected version, and investigate the blast radius.

Threat actor evidence

Every observed campaign linking this CVE to a named adversary.

Associated malware2

Malware families riding this exploit, with evidence and IOCs.

Detection signatures

YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.

Vendor-by-vendor mapping

Cross-references every affected SKU, including bundled OEM variants.

Social activity9

Community discussion across Reddit, Mastodon, and other social sources.