Privilege escalation in runc - CVE-2019-5736

 

Privilege escalation in runc - CVE-2019-5736

Published: February 12, 2019 / Updated: January 23, 2023


Vulnerability identifier: #VU17474
CSH Severity: Medium
CVSS v4: 7 [CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N]
CVE-ID: CVE-2019-5736
CWE-ID: CWE-264
Exploitation vector: Local access
Exploit availability: Public exploit is available

Vulnerability details

The vulnerability allows a remote attacker to gain elevated privileges.

The weakness exists in the runc container runtime due to file-descriptor mishandling, related to /proc/self/exe. A remote attacker can leverage 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, overwrite the host runc binary with minimal user interaction and execute arbitrary code with root privileges.

Successful exploitation of the vulnerability may result in system compromise.

Affected software

runc
Arch Linux
Gentoo Linux
Amazon Linux AMI
Red Hat Enterprise Linux Server
Red Hat Enterprise Linux for IBM z Systems
Red Hat Enterprise Linux for x86_64
Red Hat Enterprise Linux for Power
SUSE Linux Enterprise Module for Containers
SUSE Linux
Opensuse
openEuler
Fedora
IBM Cloud Automation Manager
runc (Alpine package)
flatpak (Alpine package)
runc
runc-debuginfo
flatpak
containerd
docker-latest
docker
lxc
lxcfs
python3-lxc
moby-engine
docker-debuginfo
vCloud Director Container Service Extension
vSphere Integrated Containers
VMware PKS
Integrated OpenStack

How to mitigate CVE-2019-5736

To prevent this attack, LXC has been patched to create a temporary copy of the calling binary itself when it starts or attaches to containers (cf. 6400238d08cdf1ca20d49bafb85f4e224348bf9d).

runc (Alpine package) - addressed in versions 1.0.0_rc6-r1, 1.0.0_rc8-r2, 1.0.0_rc91-r0
vCloud Director Container Service Extension - update to 1.2.7
flatpak (Alpine package) - update to 1.0.7-r0
VMware PKS - addressed in versions 1.2.9, 1.3.2
runc - update to 1.0.0~rc93-16.8.1
runc-debuginfo - update to 1.0.0~rc93-16.8.1
runc - addressed in versions 1.0.0-68.dev.git6635b4f.fc28, 1.0.0-68.dev.git6635b4f.fc29, 1.0.0-92.dev.gitc1b8c57.fc29, 1.0.0-92.dev.gitc1b8c57.fc30
flatpak - addressed in versions 1.0.7-1.fc28, 1.2.3-1.fc29
containerd - update to 1.4.4-16.38.1
docker-latest - update to 1.13.1-42.git1185cfd.fc29
docker - addressed in versions 1.13.1-65.git1185cfd.fc28, 1.13.1-65.git1185cfd.fc29
lxc - addressed in versions 3.0.4-1.fc29, 3.0.4-1.fc30
lxcfs - addressed in versions 3.0.4-1.fc29, 3.0.4-1.fc30
python3-lxc - addressed in versions 3.0.4-1.fc29, 3.0.4-1.fc30
lxc - update to 4.0.1-2020052701
moby-engine - addressed in versions 18.06.0-2.ce.git0ffa825.fc28, 18.06.0-2.ce.git0ffa825.fc29
docker-debuginfo - update to 20.10.6_ce-98.66.1
docker - update to 20.10.6_ce-98.66.1

Links to Public Exploits and PoC-codes

External References

Related Security Bulletins