# CVE-2021-30465: mount destinations can be swapped via symlink-exchange to cause mounts outside the rootfs

> Attackers can escape container isolation via a race condition in runc, enabling code execution and privilege escalation on the host.

- **Severity:** High 8.5 (`CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 27 May 2021
- **Updated:** 3 Aug 2024
- **Also known as:** ALSA-2021:2291, ALSA-2021:2370, ALSA-2021:2371, AZL-44262, CLEANSTART-2026-EN07365, DEBIAN-CVE-2021-30465, GHSA-c3xm-pvg7-gh7r, GO-2022-0914, MGASA-2021-0412, OESA-2021-1215, RHSA-2021:1566, RHSA-2021:2057, RHSA-2021:2144, RHSA-2021:2145, RHSA-2021:2150, RHSA-2021:2291, RHSA-2021:2292, RHSA-2021:2370, RHSA-2021:2371, RLSA-2021:2291, RLSA-2021:2370, RLSA-2021:2371, SUSE-SU-2021:1885-1, UBUNTU-CVE-2021-30465, USN-4960-1

## What is CVE-2021-30465?

CVE-2021-30465 is a high-severity path traversal vulnerability in Fedoraproject Fedora, published on 27 May 2021. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

runc before 1.0.0-rc95 allows a Container Filesystem Breakout via Directory Traversal. To exploit the vulnerability, an attacker must be able to create multiple containers with a fairly specific mount configuration. The problem occurs via a symlink-exchange attack that relies on a race condition.

Weakness: CWE-362 (Concurrent Execution using Shared Resource with Improper Synchronization)

## Which versions are affected by CVE-2021-30465?

3 open source packages ship an affected version, including github.com/opencontainers/runc. It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/opencontainers/runc` | Go | All versions | 1.0.0-rc95 |
| `github.com/opencontainers/runc` | Go | All versions | 1.0.0-rc95 |
| `github.com/opencontainers/runc` | Go | All versions | 1.0.0-rc95 |
| `cockpit-podman` | AlmaLinux:8 | All versions | 11-1.module_el8.5.0+108+00865455 |
| `cockpit-podman` | AlmaLinux:8 | All versions | 11-1.module_el8.5.0+2635+e4386a39 |
| `cockpit-podman` | AlmaLinux:8 | All versions | 29-2.module_el8.6.0+2876+9ed4eae2 |
| `cockpit-podman` | AlmaLinux:8 | All versions | 29-2.module_el8.6.0+2876+9ed4eae2 |
| `conmon` | AlmaLinux:8 | All versions | 2:2.0.15-1.module_el8.5.0+108+00865455 |
| `conmon` | AlmaLinux:8 | All versions | 2:2.0.15-1.module_el8.5.0+2635+e4386a39 |
| `conmon` | AlmaLinux:8 | All versions | 2:2.0.26-1.module_el8.6.0+2876+9ed4eae2 |
| `conmon` | AlmaLinux:8 | All versions | 2:2.0.26-3.module_el8.7.0+3406+a17c4180 |
| `container-selinux` | AlmaLinux:8 | All versions | 2:2.130.0-1.module_el8.5.0+108+00865455 |
| `container-selinux` | AlmaLinux:8 | All versions | 2:2.130.0-1.module_el8.5.0+2635+e4386a39 |
| `containernetworking-plugins` | AlmaLinux:8 | All versions | 0.8.3-4.module_el8.5.0+108+00865455 |
| `containernetworking-plugins` | AlmaLinux:8 | All versions | 0.8.3-4.module_el8.5.0+2635+e4386a39 |
| `containernetworking-plugins` | AlmaLinux:8 | All versions | 0.9.1-1.module_el8.6.0+2876+9ed4eae2 |
| `containernetworking-plugins` | AlmaLinux:8 | All versions | 0.9.1-1.module_el8.6.0+2876+9ed4eae2 |
| `containers-common` | AlmaLinux:8 | All versions | 1:0.1.41-4.module_el8.5.0+108+00865455 |
| `containers-common` | AlmaLinux:8 | All versions | 1:0.1.41-4.module_el8.5.0+2635+e4386a39 |
| `crit` | AlmaLinux:8 | All versions | 3.12-9.module_el8.3.0+2044+12421f43 |
| `crit` | AlmaLinux:8 | All versions | 3.12-9.module_el8.4.0+2496+12421f43 |
| `crit` | AlmaLinux:8 | All versions | 3.12-9.module_el8.5.0+119+9a9ec082 |
| `crit` | AlmaLinux:8 | All versions | 3.15-1.module_el8.6.0+2876+9ed4eae2 |
| `crit` | AlmaLinux:8 | All versions | 3.15-1.module_el8.6.0+2876+9ed4eae2 |
| `criu` | AlmaLinux:8 | All versions | 3.12-9.module_el8.3.0+2044+12421f43 |
| `criu` | AlmaLinux:8 | All versions | 3.12-9.module_el8.4.0+2496+12421f43 |
| `criu` | AlmaLinux:8 | All versions | 3.12-9.module_el8.5.0+119+9a9ec082 |
| `criu` | AlmaLinux:8 | All versions | 3.15-1.module_el8.6.0+2876+9ed4eae2 |
| `criu` | AlmaLinux:8 | All versions | 3.15-1.module_el8.6.0+2876+9ed4eae2 |
| `fuse-overlayfs` | AlmaLinux:8 | All versions | 0.7.8-1.module_el8.5.0+108+00865455 |
| `fuse-overlayfs` | AlmaLinux:8 | All versions | 0.7.8-1.module_el8.5.0+2635+e4386a39 |
| `fuse-overlayfs` | AlmaLinux:8 | All versions | 1.4.0-2.module_el8.6.0+2876+9ed4eae2 |
| `libslirp` | AlmaLinux:8 | All versions | 4.3.1-1.module_el8.6.0+2876+9ed4eae2 |
| `libslirp` | AlmaLinux:8 | All versions | 4.3.1-1.module_el8.6.0+2876+9ed4eae2 |
| `libslirp-devel` | AlmaLinux:8 | All versions | 4.3.1-1.module_el8.6.0+2876+9ed4eae2 |
| `libslirp-devel` | AlmaLinux:8 | All versions | 4.3.1-1.module_el8.6.0+2876+9ed4eae2 |
| `python-podman-api` | AlmaLinux:8 | All versions | 1.2.0-0.2.gitd0a45fe.module_el8.5.0+108+00865455 |
| `python-podman-api` | AlmaLinux:8 | All versions | 1.2.0-0.2.gitd0a45fe.module_el8.5.0+2635+e4386a39 |
| `python3-criu` | AlmaLinux:8 | All versions | 3.12-9.module_el8.3.0+2044+12421f43 |
| `python3-criu` | AlmaLinux:8 | All versions | 3.12-9.module_el8.4.0+2496+12421f43 |

Products: Fedoraproject Fedora, Linuxfoundation Runc.

## How do I fix CVE-2021-30465?

Upgrade github.com/opencontainers/runc to 1.0.0-rc95 or later.

## Is CVE-2021-30465 being exploited?

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

## Other vulnerabilities in Fedoraproject Fedora

- [CVE-2024-4577](https://insights.sbomify.com/CVE-2024-4577/): PHP-CGI OS Command Injection (critical 9.8, exploited in the wild)
- [CVE-2021-39226](https://insights.sbomify.com/CVE-2021-39226/): Grafana Authentication Bypass (critical 9.8, exploited in the wild)
- [CVE-2019-5544](https://insights.sbomify.com/CVE-2019-5544/): VMware ESXi and Horizon DaaS OpenSLP Heap-Based Buffer Overflow (critical 9.8, exploited in the wild)
- [CVE-2024-4947](https://insights.sbomify.com/CVE-2024-4947/): Google Chromium V8 Type Confusion (critical 9.6, exploited in the wild)
- [CVE-2024-4671](https://insights.sbomify.com/CVE-2024-4671/): Google Chromium Visuals Use-After-Free (critical 9.6, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2021-30465 and fix it if it is affected.

What it is: CVE-2021-30465 is a high-severity path traversal vulnerability in Fedoraproject Fedora, published on 27 May 2021. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2021-30465 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/opencontainers/runc (Go): affected all versions; fixed in 1.0.0-rc95
- github.com/opencontainers/runc (Go): affected all versions; fixed in 1.0.0-rc95
- github.com/opencontainers/runc (Go): affected all versions; fixed in 1.0.0-rc95

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

## Sources

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

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