# CVE-2021-29136: Improper input validation in umoci

> Attackers can overwrite arbitrary host files via symlink traversal in umoci when unpacking crafted images, potentially leading to code execution.

- **Severity:** Medium 5.5 (`CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 6 Apr 2021
- **Updated:** 3 Aug 2024
- **Also known as:** DEBIAN-CVE-2021-29136, GHSA-9m95-8hx6-7p9v, GO-2022-0815, OESA-2021-1151, SUSE-SU-2021:1116-1, SUSE-SU-2021:1863-1, SUSE-SU-2021:1863-2, UBUNTU-CVE-2021-29136, openSUSE-SU-2021:0548-1, openSUSE-SU-2021:0810-1, openSUSE-SU-2021:0846-1, openSUSE-SU-2021:1863-1, openSUSE-SU-2024:11482-1

## What is CVE-2021-29136?

CVE-2021-29136 is a medium-severity path traversal vulnerability in n/a, published on 6 Apr 2021. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

Open Container Initiative umoci before 0.4.7 allows attackers to overwrite arbitrary host paths via a crafted image that causes symlink traversal when "umoci unpack" or "umoci raw unpack" is used.

Weakness: CWE-20 (Improper Input Validation)

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

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/opencontainers/umoci` | Go | All versions | 0.4.7 |
| `github.com/opencontainers/umoci` | Go | All versions | 0.4.7 |
| `github.com/opencontainers/umoci` | Go | All versions | 0.4.7 |
| `umoci` | SUSE:Enterprise Storage 6 | All versions | 0.4.6-3.9.1 |
| `umoci` | SUSE:Enterprise Storage 6 | All versions | 0.4.7-3.12.1 |
| `umoci` | SUSE:Linux Enterprise High Performance Computing 15 SP1-ESPOS | All versions | 0.4.6-3.9.1 |
| `umoci` | SUSE:Linux Enterprise High Performance Computing 15 SP1-ESPOS | All versions | 0.4.7-3.12.1 |
| `umoci` | SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS | All versions | 0.4.6-3.9.1 |
| `umoci` | SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS | All versions | 0.4.7-3.12.1 |
| `umoci` | SUSE:Linux Enterprise Module for Basesystem 15 SP3 | All versions | 0.4.7-3.12.1 |
| `umoci` | SUSE:Linux Enterprise Module for Containers 15 SP2 | All versions | 0.4.6-3.9.1 |
| `umoci` | SUSE:Linux Enterprise Module for Containers 15 SP2 | All versions | 0.4.7-3.12.1 |
| `umoci` | SUSE:Linux Enterprise Module for Containers 15 SP3 | All versions | 0.4.7-3.12.1 |
| `umoci` | SUSE:Linux Enterprise Server 15 SP1-BCL | All versions | 0.4.6-3.9.1 |
| `umoci` | SUSE:Linux Enterprise Server 15 SP1-BCL | All versions | 0.4.7-3.12.1 |
| `umoci` | SUSE:Linux Enterprise Server 15 SP1-LTSS | All versions | 0.4.6-3.9.1 |
| `umoci` | SUSE:Linux Enterprise Server 15 SP1-LTSS | All versions | 0.4.7-3.12.1 |
| `umoci` | SUSE:Linux Enterprise Server for SAP Applications 15 SP1 | All versions | 0.4.6-3.9.1 |
| `umoci` | SUSE:Linux Enterprise Server for SAP Applications 15 SP1 | All versions | 0.4.7-3.12.1 |
| `umoci` | SUSE:Manager Proxy 4.0 | All versions | 0.4.6-3.9.1 |
| `umoci` | SUSE:Manager Proxy 4.0 | All versions | 0.4.7-3.12.1 |
| `umoci` | SUSE:Manager Retail Branch Server 4.0 | All versions | 0.4.6-3.9.1 |
| `umoci` | SUSE:Manager Retail Branch Server 4.0 | All versions | 0.4.7-3.12.1 |
| `umoci` | SUSE:Manager Server 4.0 | All versions | 0.4.6-3.9.1 |
| `umoci` | SUSE:Manager Server 4.0 | All versions | 0.4.7-3.12.1 |
| `singularity` | SUSE:Package Hub 15 SP2 | All versions | 3.7.3-bp152.2.19.3 |
| `umoci` | openSUSE:Leap 15.2 | All versions | 0.4.6-lp152.2.3.1 |
| `umoci` | openSUSE:Leap 15.2 | All versions | 0.4.7-lp152.2.6.1 |
| `umoci` | openSUSE:Leap 15.3 | All versions | 0.4.7-3.12.1 |
| `umoci` | openSUSE:Tumbleweed | All versions | 0.4.7-2.3 |

Products: Linuxfoundation Umoci, Sylabs Singularity.

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

Upgrade github.com/opencontainers/umoci to 0.4.7 or later.

## Is CVE-2021-29136 being exploited?

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

## Fix prompt for AI coding agents

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

What it is: CVE-2021-29136 is a medium-severity path traversal vulnerability in n/a, published on 6 Apr 2021. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2021-29136 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/opencontainers/umoci (Go): affected all versions; fixed in 0.4.7
- github.com/opencontainers/umoci (Go): affected all versions; fixed in 0.4.7
- github.com/opencontainers/umoci (Go): affected all versions; fixed in 0.4.7

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

## Sources

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

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