# CVE-2021-20206: containernetworking/cni improper limitation of path name

> Attackers can execute arbitrary system binaries via path traversal in CNI plugin configuration, compromising container network integrity and availability.

- **Severity:** High 7.2 (`CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** An administrator
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 26 Mar 2021
- **Updated:** 3 Aug 2024
- **Also known as:** AZL-44838, CLEANSTART-2024-OS27994, DEBIAN-CVE-2021-20206, GHSA-xjqr-g762-pxwp, GO-2022-0230, SNYK-GOLANG-GITHUBCOMCONTAINERNETWORKINGCNIPKGINVOKE-1070549, SUSE-SU-2022:4150-1, SUSE-SU-2022:4592-1, SUSE-SU-2022:4593-1, UBUNTU-CVE-2021-20206, openSUSE-SU-2024:12371-1, openSUSE-SU-2024:12512-1, openSUSE-SU-2024:12513-1

## What is CVE-2021-20206?

CVE-2021-20206 is a high-severity path traversal vulnerability in containernetworking-cni, published on 26 Mar 2021. An attacker needs administrator access to exploit it, with no action from the victim.

### Official description

An improper limitation of path name flaw was found in containernetworking/cni in versions before 0.8.1. When specifying the plugin to load in the 'type' field in the network configuration, it is possible to use special elements such as "../" separators to reference binaries elsewhere on the system. This flaw allows an attacker to execute other existing binaries other than the cni plugins/types, such as 'reboot'. The highest threat from this vulnerability is to confidentiality, integrity, as well as system availability.

Weakness: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory), CWE-20 (Improper Input Validation)

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

3 open source packages ship an affected version, including github.com/containernetworking/cni. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/containernetworking/cni` | Go | All versions | 0.8.1 |
| `github.com/containernetworking/cni` | Go | All versions | 0.8.1 |
| `github.com/containernetworking/cni` | Go | All versions | 0.8.1 |
| `cni` | SUSE:Enterprise Storage 6 | All versions | 0.7.1-150100.3.8.1 |
| `cni-plugins` | SUSE:Enterprise Storage 6 | All versions | 0.8.6-150100.3.11.1 |
| `cni` | SUSE:Enterprise Storage 7 | All versions | 0.7.1-150100.3.8.1 |
| `cni-plugins` | SUSE:Enterprise Storage 7 | All versions | 0.8.6-150100.3.11.1 |
| `cni` | SUSE:Enterprise Storage 7.1 | All versions | 0.7.1-150100.3.8.1 |
| `cni-plugins` | SUSE:Enterprise Storage 7.1 | All versions | 0.8.6-150100.3.11.1 |
| `cni` | SUSE:Linux Enterprise High Performance Computing 15 SP1-ESPOS | All versions | 0.7.1-150100.3.8.1 |
| `cni-plugins` | SUSE:Linux Enterprise High Performance Computing 15 SP1-ESPOS | All versions | 0.8.6-150100.3.11.1 |
| `cni` | SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS | All versions | 0.7.1-150100.3.8.1 |
| `cni-plugins` | SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS | All versions | 0.8.6-150100.3.11.1 |
| `cni` | SUSE:Linux Enterprise High Performance Computing 15 SP2-ESPOS | All versions | 0.7.1-150100.3.8.1 |
| `cni-plugins` | SUSE:Linux Enterprise High Performance Computing 15 SP2-ESPOS | All versions | 0.8.6-150100.3.11.1 |
| `cni` | SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | All versions | 0.7.1-150100.3.8.1 |
| `cni-plugins` | SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | All versions | 0.8.6-150100.3.11.1 |
| `cni` | SUSE:Linux Enterprise Micro 5.1 | All versions | 0.7.1-150100.3.8.1 |
| `cni-plugins` | SUSE:Linux Enterprise Micro 5.1 | All versions | 0.8.6-150100.3.11.1 |
| `cni` | SUSE:Linux Enterprise Micro 5.2 | All versions | 0.7.1-150100.3.8.1 |
| `cni-plugins` | SUSE:Linux Enterprise Micro 5.2 | All versions | 0.8.6-150100.3.11.1 |
| `cni` | SUSE:Linux Enterprise Micro 5.3 | All versions | 0.7.1-150100.3.8.1 |
| `cni-plugins` | SUSE:Linux Enterprise Micro 5.3 | All versions | 0.8.6-150100.3.11.1 |
| `cni` | SUSE:Linux Enterprise Module for Containers 15 SP3 | All versions | 0.7.1-150100.3.8.1 |
| `cni-plugins` | SUSE:Linux Enterprise Module for Containers 15 SP3 | All versions | 0.8.6-150100.3.11.1 |
| `cni` | SUSE:Linux Enterprise Module for Containers 15 SP4 | All versions | 0.7.1-150100.3.8.1 |
| `cni-plugins` | SUSE:Linux Enterprise Module for Containers 15 SP4 | All versions | 0.8.6-150100.3.11.1 |
| `cni` | SUSE:Linux Enterprise Module for Public Cloud 15 | All versions | 0.7.1-150000.1.7.1 |
| `cni` | SUSE:Linux Enterprise Module for Public Cloud 15 SP1 | All versions | 0.7.1-150100.3.8.1 |
| `cni-plugins` | SUSE:Linux Enterprise Module for Public Cloud 15 SP1 | All versions | 0.8.6-150100.3.11.1 |
| `cni` | SUSE:Linux Enterprise Module for Public Cloud 15 SP2 | All versions | 0.7.1-150100.3.8.1 |
| `cni-plugins` | SUSE:Linux Enterprise Module for Public Cloud 15 SP2 | All versions | 0.8.6-150100.3.11.1 |
| `cni` | SUSE:Linux Enterprise Server 15 SP1-BCL | All versions | 0.7.1-150100.3.8.1 |
| `cni-plugins` | SUSE:Linux Enterprise Server 15 SP1-BCL | All versions | 0.8.6-150100.3.11.1 |
| `cni` | SUSE:Linux Enterprise Server 15 SP1-LTSS | All versions | 0.7.1-150100.3.8.1 |
| `cni-plugins` | SUSE:Linux Enterprise Server 15 SP1-LTSS | All versions | 0.8.6-150100.3.11.1 |
| `cni` | SUSE:Linux Enterprise Server 15 SP2-BCL | All versions | 0.7.1-150100.3.8.1 |
| `cni-plugins` | SUSE:Linux Enterprise Server 15 SP2-BCL | All versions | 0.8.6-150100.3.11.1 |
| `cni` | SUSE:Linux Enterprise Server 15 SP2-LTSS | All versions | 0.7.1-150100.3.8.1 |
| `cni-plugins` | SUSE:Linux Enterprise Server 15 SP2-LTSS | All versions | 0.8.6-150100.3.11.1 |

Products: Linuxfoundation Container Network Interface.

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

Upgrade github.com/containernetworking/cni to 0.8.1 or later.

## Is CVE-2021-20206 being exploited?

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

## Fix prompt for AI coding agents

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

What it is: CVE-2021-20206 is a high-severity path traversal vulnerability in containernetworking-cni, published on 26 Mar 2021. An attacker needs administrator access to exploit it, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2021-20206 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/containernetworking/cni (Go): affected all versions; fixed in 0.8.1
- github.com/containernetworking/cni (Go): affected all versions; fixed in 0.8.1
- github.com/containernetworking/cni (Go): affected all versions; fixed in 0.8.1

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

## Sources

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

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