# CVE-2019-5736: Privilege escalation in n/a

> Attackers with container access can overwrite the host runc binary to gain root privileges on the host system.

- **Severity:** High 8.6 (`CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 11 Feb 2019
- **Updated:** 4 Aug 2024
- **Also known as:** ALPINE-CVE-2019-5736, ALSA-2019:0975, CLEANSTART-2026-BP85403, DEBIAN-CVE-2019-5736, GHSA-gxmr-w5mj-v8hh, MGASA-2019-0068, MGASA-2019-0087, RHSA-2019:0303, RHSA-2019:0304, RHSA-2019:0408, RHSA-2019:0975, RLSA-2019:0975, SUSE-SU-2019:0362-1, SUSE-SU-2019:0385-1, UBUNTU-CVE-2019-5736, openSUSE-SU-2019:0252-1, openSUSE-SU-2019:2245-1, openSUSE-SU-2019:2286-1

## What is CVE-2019-5736?

CVE-2019-5736 is a high-severity vulnerability in Canonical Ubuntu Linux, published on 11 Feb 2019. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

### Official description

runc through 1.0-rc6, as used in Docker before 18.09.2 and other products, allows attackers to overwrite the host runc binary (and consequently obtain host root access) by leveraging the ability to execute a command as root within one of these types of containers: (1) a new container with an attacker-controlled image, or (2) an existing container, to which the attacker previously had write access, that can be attached with docker exec. This occurs because of file-descriptor mishandling, related to /proc/self/exe.

Weakness: CWE-78 (Improper Neutralization of Special Elements used in an OS Command)

## Which versions are affected by CVE-2019-5736?

It affects 19 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `oci-systemd-hook` | AlmaLinux:8 | All versions | 1:0.1.15-2.git2d0b8a3.module_el8.3.0+2044+12421f43 |
| `oci-systemd-hook` | AlmaLinux:8 | All versions | 1:0.1.15-2.git2d0b8a3.module_el8.4.0+2496+12421f43 |
| `oci-systemd-hook` | AlmaLinux:8 | All versions | 1:0.1.15-2.git2d0b8a3.module_el8.5.0+119+9a9ec082 |
| `oci-umount` | AlmaLinux:8 | All versions | 2:2.3.4-2.git87f9237.module_el8.3.0+2044+12421f43 |
| `oci-umount` | AlmaLinux:8 | All versions | 2:2.3.4-2.git87f9237.module_el8.4.0+2496+12421f43 |
| `oci-umount` | AlmaLinux:8 | All versions | 2:2.3.4-2.git87f9237.module_el8.5.0+119+9a9ec082 |
| `buildah` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.5-3.gite94b4f9.module+el8.0.0+2958+4e823551 |
| `buildah-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.5-3.gite94b4f9.module+el8.0.0+2958+4e823551 |
| `buildah-debugsource` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.5-3.gite94b4f9.module+el8.0.0+2958+4e823551 |
| `container-selinux` | Red Hat:enterprise_linux:8::appstream | All versions | 2:2.94-1.git1e99f1d.module+el8.0.0+2958+4e823551 |
| `containernetworking-plugins` | Red Hat:enterprise_linux:8::appstream | All versions | 0:0.7.4-3.git9ebe139.module+el8.0.0+2958+4e823551 |
| `containernetworking-plugins-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:0.7.4-3.git9ebe139.module+el8.0.0+2958+4e823551 |
| `containernetworking-plugins-debugsource` | Red Hat:enterprise_linux:8::appstream | All versions | 0:0.7.4-3.git9ebe139.module+el8.0.0+2958+4e823551 |
| `containers-common` | Red Hat:enterprise_linux:8::appstream | All versions | 1:0.1.32-3.git1715c90.module+el8.0.0+2958+4e823551 |
| `fuse-overlayfs` | Red Hat:enterprise_linux:8::appstream | All versions | 0:0.3-2.module+el8.0.0+2958+4e823551 |
| `fuse-overlayfs-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:0.3-2.module+el8.0.0+2958+4e823551 |
| `fuse-overlayfs-debugsource` | Red Hat:enterprise_linux:8::appstream | All versions | 0:0.3-2.module+el8.0.0+2958+4e823551 |
| `oci-systemd-hook` | Red Hat:enterprise_linux:8::appstream | All versions | 1:0.1.15-2.git2d0b8a3.module+el8.0.0+2958+4e823551 |
| `oci-systemd-hook-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 1:0.1.15-2.git2d0b8a3.module+el8.0.0+2958+4e823551 |
| `oci-systemd-hook-debugsource` | Red Hat:enterprise_linux:8::appstream | All versions | 1:0.1.15-2.git2d0b8a3.module+el8.0.0+2958+4e823551 |
| `oci-umount` | Red Hat:enterprise_linux:8::appstream | All versions | 2:2.3.4-2.git87f9237.module+el8.0.0+2958+4e823551 |
| `oci-umount-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 2:2.3.4-2.git87f9237.module+el8.0.0+2958+4e823551 |
| `oci-umount-debugsource` | Red Hat:enterprise_linux:8::appstream | All versions | 2:2.3.4-2.git87f9237.module+el8.0.0+2958+4e823551 |
| `podman` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.0.0-2.git921f98f.module+el8.0.0+2958+4e823551 |
| `podman-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.0.0-2.git921f98f.module+el8.0.0+2958+4e823551 |
| `podman-debugsource` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.0.0-2.git921f98f.module+el8.0.0+2958+4e823551 |
| `podman-docker` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.0.0-2.git921f98f.module+el8.0.0+2958+4e823551 |
| `runc` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.0.0-55.rc5.dev.git2abd837.module+el8.0.0+3049+59fd2bba |
| `runc-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.0.0-55.rc5.dev.git2abd837.module+el8.0.0+3049+59fd2bba |
| `runc-debugsource` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.0.0-55.rc5.dev.git2abd837.module+el8.0.0+3049+59fd2bba |
| `skopeo` | Red Hat:enterprise_linux:8::appstream | All versions | 1:0.1.32-3.git1715c90.module+el8.0.0+2958+4e823551 |
| `skopeo-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 1:0.1.32-3.git1715c90.module+el8.0.0+2958+4e823551 |
| `skopeo-debugsource` | Red Hat:enterprise_linux:8::appstream | All versions | 1:0.1.32-3.git1715c90.module+el8.0.0+2958+4e823551 |
| `slirp4netns` | Red Hat:enterprise_linux:8::appstream | All versions | 0:0.1-2.dev.gitc4e1bc5.module+el8.0.0+2958+4e823551 |
| `slirp4netns-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:0.1-2.dev.gitc4e1bc5.module+el8.0.0+2958+4e823551 |
| `slirp4netns-debugsource` | Red Hat:enterprise_linux:8::appstream | All versions | 0:0.1-2.dev.gitc4e1bc5.module+el8.0.0+2958+4e823551 |
| `docker` | Red Hat:openshift:3.4::el7 | All versions | 2:1.12.6-79.git5680db5.el7 |
| `docker-client` | Red Hat:openshift:3.4::el7 | All versions | 2:1.12.6-79.git5680db5.el7 |
| `docker-common` | Red Hat:openshift:3.4::el7 | All versions | 2:1.12.6-79.git5680db5.el7 |
| `docker-debuginfo` | Red Hat:openshift:3.4::el7 | All versions | 2:1.12.6-79.git5680db5.el7 |

Products: Apache Mesos, Canonical Ubuntu Linux, D2iq Dc\/Os, D2iq Kubernetes Engine, Docker Docker, Fedoraproject Fedora, Google Kubernetes Engine, Hp Onesphere, Linuxcontainers Lxc, Linuxfoundation Runc, Microfocus Service Management Automation, Netapp Hci Management Node, Netapp Solidfire, Opensuse Backports Sle, Opensuse Leap, Redhat Container Development Kit, Redhat Enterprise Linux, Redhat Enterprise Linux Server, Redhat Openshift.

## How do I fix CVE-2019-5736?

Upgrade to a fixed version.

## Is CVE-2019-5736 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2019-5736 exists.

Public exploit code:

- PoC for CVE-2019-5736 (github_poc): https://github.com/Frichetten/CVE-2019-5736-PoC
- Unweaponized Proof of Concept for CVE-2019-5736 (Docker escape) (github_poc): https://github.com/q3k/cve-2019-5736-poc
- CVE-2019-5736 POCs (github_poc): https://github.com/twistlock/RunC-CVE-2019-5736
- runc容器逃逸漏洞预警 (github_poc): https://github.com/jas502n/CVE-2019-5736
- getshell test (github_poc): https://github.com/agppp/cve-2019-5736-poc
- Code sample for using exploit CVE-2019-5736 to mine bitcoin with no association to original container or user. (github_poc): https://github.com/epsteina16/Docker-Escape-Miner

## Other vulnerabilities in Canonical Ubuntu Linux

- [CVE-2019-0204](https://insights.sbomify.com/CVE-2019-0204/): Docker image code execution with Apache Mesos (high 7.8)
- [CVE-2018-11793](https://insights.sbomify.com/CVE-2018-11793/): Stack Overflow in Apache Mesos (high 7.5)
- [CVE-2018-1330](https://insights.sbomify.com/CVE-2018-1330/): Crash when decoding malformed HTTP requests or malformed JSON payload (high 7.5)
- [CVE-2017-7687](https://insights.sbomify.com/CVE-2017-7687/): Denial of service in Apache Mesos (high 7.5)
- [CVE-2017-9790](https://insights.sbomify.com/CVE-2017-9790/): Use after free in Apache Mesos (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2019-5736 and fix it if it is affected.

What it is: CVE-2019-5736 is a high-severity vulnerability in Canonical Ubuntu Linux, published on 11 Feb 2019. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2019-5736 exists.

Affected product: Canonical Ubuntu Linux. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2019-5736/ (Markdown: https://insights.sbomify.com/CVE-2019-5736/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2019-5736
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2019-5736
- OSV: https://osv.dev/vulnerability/CVE-2019-5736

---
From sbomify Insights: https://insights.sbomify.com/CVE-2019-5736/
Summaries are generated and may contain mistakes; the official description above is the record.
