CVE-2021-20206 is a high-severity (CVSS 7.2) Improper Input Validation vulnerability in github.com/containernetworking/cni. A fix is available for github.com/containernetworking/cni — see the affected versions and patch details below.
containernetworking/cni improper limitation of path name
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
CVE-2021-20206 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.
Where this sits among everything scored
Of 385,738 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
github.com/containernetworking/cniReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.
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.
Specific Go Packages Affected
github.com/containernetworking/cni/pkg/invoke
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐹Go | github.com/containernetworking/cni | all versions | 0.8.1go get github.com/containernetworking/cni@v0.8.1 |
Affected Products
container network interfacelinuxfoundationDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for github.com/containernetworking/cni, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update github.com/containernetworking/cni to 0.8.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2021-20206 is resolved across your whole dependency graph.
Workarounds
Resolve every user-supplied path to its canonical form and reject anything that escapes the intended directory, and run the component under an account that has no read or write access outside the directory it legitimately serves.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
OpenShift ServiceMesh (OSSM) does package a vulnerable version of containernetworking/cni, however, the NetworkDefinitionAttachment is defined in code and cannot be easily changed except through a user who has access to the operator namespace such as cluster-admin. As such, for OSSM, the impact is Moderate. The fix…
| Product | Fixed in | Advisory |
|---|---|---|
| Red Hat OpenShift Container Platform 4.7 | openshift4/ose-docker-builder:v4.7.0-202103270130.p0 | RHSA-2021:1005 |
| Red Hat OpenShift Container Platform 4.7 | openshift4/ose-sriov-cni:v4.7.0-202103270130.p0 | RHSA-2021:1007 |
| Red Hat OpenShift Container Platform 4.7 | openshift4/ose-sriov-infiniband-cni:v4.7.0-202104281843.p0 | RHSA-2021:1552 |
| Red Hat OpenShift Container Platform 4.7 | openshift4/ose-container-networking-plugins-rhel8:v4.7.0-202201261537.p0.ga3cf46b.assembly.stream | RHSA-2022:0492 |
| Red Hat OpenShift Container Platform 4.7 | openshift4-wincw/windows-machine-config-rhel8-operator:2.0.5-4 | RHSA-2022:1660 |
| Red Hat OpenShift Container Platform 4.8 | openshift4/ose-container-networking-plugins-rhel8:v4.8.0-202106291913.p0.git.a8801b0.assembly.stream | RHSA-2021:2438 |
| Red Hat OpenShift Container Platform 4.8 | openshift4-wincw/windows-machine-config-rhel8-operator:3.0.0-16 | RHSA-2021:3001 |
Frequently Asked Questions
Is CVE-2021-20206 in your dependencies?
Find it across Go, including transitive dependencies.