CVE-2024-45310
runc can be confused to create empty files/directories on the host
Check your servers for CVE-2024-45310
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2024-45310 affects runc, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
Description
runc is a CLI tool for spawning and running containers according to the OCI specification. runc 1.1.13 and earlier, as well as 1.2.0-rc2 and earlier, can be tricked into creating empty files or directories in arbitrary locations in the host filesystem by sharing a volume between two containers and exploiting a race with `os.MkdirAll`. While this could be used to create empty files, existing files would not be truncated. An attacker must have the ability to start containers using some kind of custom volume configuration. Containers using user namespaces are still affected, but the scope of places an attacker can create inodes can be significantly reduced. Sufficiently strict LSM policies (SELinux/Apparmor) can also in principle block this attack -- we suspect the industry standard SELinux policy may restrict this attack's scope but the exact scope of protection hasn't been analysed. This is exploitable using runc directly as well as through Docker and Kubernetes. The issue is fixed in runc v1.1.14 and v1.2.0-rc3.
Some workarounds are available. Using user namespaces restricts this attack fairly significantly such that the attacker can only create inodes in directories that the remapped root user/group has write access to. Unless the root user is remapped to an actual user on the host (such as with rootless containers that don't use `/etc/sub[ug]id`), this in practice means that an attacker would only be able to create inodes in world-writable directories. A strict enough SELinux or AppArmor policy could in principle also restrict the scope if a specific label is applied to the runc runtime, though neither the extent to which the standard existing policies block this attack nor what exact policies are needed to sufficiently restrict this attack have been thoroughly tested.
Severity (CVSS)
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:N/I:L/A:N
- Attack vector
- local: the attacker needs local access, or a user has to open a prepared file
- Attack complexity
- low: an attack works without special conditions
- Privileges required
- none: the attacker does not need an account
- User interaction
- required: a user has to do something, such as open a link or a file
- Scope
- changed: the damage reaches other components, such as the host of a container or other users
- Impact
- confidentiality none, integrity low, availability none: what an attacker can read (confidentiality), change (integrity) or stop (availability)
Exploitation
EPSS 0.32%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 26.6% of all scored CVEs. Scores of 1 Dec 2026.
The assessment of CISA (SSVC, 3 Sep 2024):
- Exploitation
- none: CISA did not find evidence of exploitation or a public proof of concept
- Automatable
- no: each attack takes manual steps
- Technical impact
- partial: limited control or limited data
Weakness
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| runc |
affected < 1.1.14 affected >= 1.2.0-rc-1, < 1.2.0-rc.3
|
Is my server affected?
Find the installed version of runc and compare it with the fixed version of your distribution. Distributions often fix a CVE in a package version of their own, so the version number of the upstream project can mislead.
Debian, Ubuntu
dpkg -l | grep -i runc
# packages whose changelog names the CVE (fixed in the installed version)
zgrep -l CVE-2024-45310 /usr/share/doc/*/changelog.Debian.gz
# Ubuntu
pro fix CVE-2024-45310RHEL, Rocky, Alma, Fedora
rpm -q runc
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2024-45310Alpine
apk list --installed | grep -i runcWith Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2024-45310
trivy image --scanners vuln IMAGE | grep CVE-2024-45310
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Advisories
Other references
- https://github.com/opencontainers/runc/pull/4359 github.com
- https://github.com/opencontainers/runc/commit/63c2908164f3a1daea455bf5bcd8d363d70328c7 github.com
- https://github.com/opencontainers/runc/commit/8781993968fd964ac723ff5f360b6f259e809a3e github.com
- https://github.com/opencontainers/runc/commit/f0b652ea61ff6750a8fcc69865d45a7abf37accf github.com
- http://www.openwall.com/lists/oss-security/2024/09/03/1 openwall.com
- https://security.netapp.com/advisory/ntap-20250221-0008/ security.netapp.com
Source: the record CVE-2024-45310 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse