# CVE-2024-45310: runc can be confused to create empty files/directories on the host

> Attackers can exploit a race condition to create empty files or directories on the host filesystem via shared volumes in runc.

- **Severity:** Low 3.6 (`CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:N/I:L/A:N`)
- **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:** 3 Sep 2024
- **Updated:** 21 Feb 2025
- **Also known as:** AZL-48519, AZL-48525, AZL-48531, AZL-48543, AZL-48555, AZL-48567, AZL-48581, AZL-48590, BELL-CVE-2024-45310, CLEANSTART-2026-OD16430, DEBIAN-CVE-2024-45310, GHSA-jfvp-7x6p-h2pv, GO-2024-3110, MGASA-2025-0004, MINI-362q-fxj6-8mr9, MINI-5mrm-c6g6-962p, MINI-8q78-62c2-jc5w, MINI-c4p8-4c4m-62xx, MINI-jj4q-w6gm-6wrw, MINI-ww69-q683-58f3, MINI-x96x-7r8q-fv32, OESA-2024-2134, OESA-2024-2135, OESA-2024-2136, OESA-2024-2137, OESA-2024-2253, SUSE-SU-2024:3222-1, SUSE-SU-2024:3324-1, SUSE-SU-2025:02198-1, SUSE-SU-2025:02198-2, SUSE-SU-2025:1374-1, SUSE-SU-2025:20046-1, SUSE-SU-2025:20335-1, SUSE-SU-2025:20353-1, UBUNTU-CVE-2024-45310, openSUSE-SU-2024:14312-1

## What is CVE-2024-45310?

CVE-2024-45310 is a low-severity vulnerability in opencontainers runc, published on 3 Sep 2024. 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 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.

Weakness: CWE-61 (UNIX Symbolic Link (Symlink) Following), CWE-363 (Race Condition Enabling Link Following)

## Which versions are affected by CVE-2024-45310?

5 open source packages ship an affected version, including github.com/opencontainers/runc. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/opencontainers/runc` | Go | All versions | 1.1.14, 1.2.0-rc.3 |
| `github.com/opencontainers/runc` | Go | All versions | 1.1.14 |
| `github.com/opencontainers/runc` | Go | All versions | 1.1.14 |
| `github.com/opencontainers/runc` | Go | From 1.2.0-rc.1 | 1.2.0-rc.3 |
| `github.com/opencontainers/runc` | Go | From 1.2.0-rc.1 | 1.2.0-rc.3 |
| `runc` | SUSE:Enterprise Storage 7.1 | All versions | 1.1.14-150000.70.1 |
| `runc` | SUSE:Enterprise Storage 7.1 | All versions | 1.2.6-150000.73.2 |
| `runc` | SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | All versions | 1.1.14-150000.70.1 |
| `runc` | SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | All versions | 1.1.14-150000.70.1 |
| `runc` | SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | All versions | 1.2.6-150000.73.2 |
| `runc` | SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 1.1.14-150000.70.1 |
| `runc` | SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 1.2.6-150000.73.2 |
| `runc` | SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | All versions | 1.1.14-150000.70.1 |
| `runc` | SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | All versions | 1.2.6-150000.73.2 |
| `runc` | SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOS | All versions | 1.2.6-150000.73.2 |
| `runc` | SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSS | All versions | 1.2.6-150000.73.2 |
| `runc` | SUSE:Linux Enterprise Micro 5.1 | All versions | 1.1.14-150000.70.1 |
| `runc` | SUSE:Linux Enterprise Micro 5.1 | All versions | 1.2.6-150000.73.2 |
| `runc` | SUSE:Linux Enterprise Micro 5.2 | All versions | 1.1.14-150000.70.1 |
| `runc` | SUSE:Linux Enterprise Micro 5.2 | All versions | 1.2.6-150000.73.2 |
| `runc` | SUSE:Linux Enterprise Micro 5.3 | All versions | 1.1.14-150000.70.1 |
| `runc` | SUSE:Linux Enterprise Micro 5.3 | All versions | 1.2.6-150000.73.2 |
| `runc` | SUSE:Linux Enterprise Micro 5.4 | All versions | 1.1.14-150000.70.1 |
| `runc` | SUSE:Linux Enterprise Micro 5.4 | All versions | 1.2.6-150000.73.2 |
| `runc` | SUSE:Linux Enterprise Micro 5.5 | All versions | 1.1.14-150000.70.1 |
| `runc` | SUSE:Linux Enterprise Micro 5.5 | All versions | 1.2.6-150000.73.2 |
| `runc` | SUSE:Linux Enterprise Module for Basesystem 15 SP7 | All versions | 1.2.6-150000.73.2 |
| `runc` | SUSE:Linux Enterprise Module for Containers 12 | All versions | 1.1.14-16.55.1 |
| `runc` | SUSE:Linux Enterprise Module for Containers 15 SP5 | All versions | 1.1.14-150000.70.1 |
| `runc` | SUSE:Linux Enterprise Module for Containers 15 SP6 | All versions | 1.1.14-150000.70.1 |
| `runc` | SUSE:Linux Enterprise Module for Containers 15 SP6 | All versions | 1.2.6-150000.73.2 |
| `runc` | SUSE:Linux Enterprise Server 12 SP5-LTSS | All versions | 1.2.6-16.60.2 |
| `runc` | SUSE:Linux Enterprise Server 15 SP2-LTSS | All versions | 1.1.14-150000.70.1 |
| `runc` | SUSE:Linux Enterprise Server 15 SP3-LTSS | All versions | 1.1.14-150000.70.1 |
| `runc` | SUSE:Linux Enterprise Server 15 SP3-LTSS | All versions | 1.2.6-150000.73.2 |
| `runc` | SUSE:Linux Enterprise Server 15 SP4-LTSS | All versions | 1.1.14-150000.70.1 |
| `runc` | SUSE:Linux Enterprise Server 15 SP4-LTSS | All versions | 1.2.6-150000.73.2 |
| `runc` | SUSE:Linux Enterprise Server 15 SP5-LTSS | All versions | 1.2.6-150000.73.2 |
| `runc` | SUSE:Linux Enterprise Server LTSS Extended Security 12 SP5 | All versions | 1.2.6-16.60.2 |
| `runc` | SUSE:Linux Enterprise Server for SAP Applications 15 SP2 | All versions | 1.1.14-150000.70.1 |

Products: Linuxfoundation Runc.

## How do I fix CVE-2024-45310?

Upgrade github.com/opencontainers/runc to a fixed version for your release line: 1.1.14 or 1.2.0-rc.3.

## Is CVE-2024-45310 being exploited?

There is no known exploitation of CVE-2024-45310 in the wild and no public exploit code.

## Other vulnerabilities in opencontainers runc

- [CVE-2025-52565](https://insights.sbomify.com/CVE-2025-52565/): container escape due to /dev/console mount and related races (high 8.4)
- [CVE-2025-31133](https://insights.sbomify.com/CVE-2025-31133/): runc container escape via "masked path" abuse due to mount race conditions (high 7.3)
- [CVE-2025-52881](https://insights.sbomify.com/CVE-2025-52881/): runc: LSM labels can be bypassed with malicious config using dummy procfs files (high 7.3)
- [CVE-2023-28642](https://insights.sbomify.com/CVE-2023-28642/): AppArmor bypass with symlinked /proc in runc (medium 6.1)
- [CVE-2023-25809](https://insights.sbomify.com/CVE-2023-25809/): rootless: `/sys/fs/cgroup` is writable when cgroupns isn't unshared in runc (medium 5.0)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-45310 and fix it if it is affected.

What it is: CVE-2024-45310 is a low-severity vulnerability in opencontainers runc, published on 3 Sep 2024. 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: There is no known exploitation of CVE-2024-45310 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/opencontainers/runc (Go): affected all versions; fixed in 1.1.14, 1.2.0-rc.3
- github.com/opencontainers/runc (Go): affected all versions; fixed in 1.1.14
- github.com/opencontainers/runc (Go): affected all versions; fixed in 1.1.14
- github.com/opencontainers/runc (Go): affected from 1.2.0-rc.1; fixed in 1.2.0-rc.3
- github.com/opencontainers/runc (Go): affected from 1.2.0-rc.1; fixed in 1.2.0-rc.3

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-2024-45310/ (Markdown: https://insights.sbomify.com/CVE-2024-45310/index.md)
```

## Sources

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

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