CVE-2021-20206: Github.com/containernetworking/cni Containernetworking/cni Improper Limitation Of Path Vulnerability

HIGH
Advisory Identifier: GHSA-xjqr-g762-pxwp
CVSS 7.2
CWE-20 CWE-22
Published
Advisory Summary

CVE-2021-20206 is a HIGH (CVSS 7.2) containernetworking/cni improper limitation of path vulnerability (CWE-20: Improper Input Validation) affecting Github.com/containernetworking/cni libraries in the Go ecosystem. The issue involves containernetworking/cni improper limitation of path name. Remediation is available by upgrading affected packages to version 0.8.1.

CVE-2021-20206 at a Glance

CVE Identifier CVE-2021-20206
GHSA Identifier GHSA-xjqr-g762-pxwp
Severity HIGH
CVSS v3.1 Base Score 7.2
CWE Classification CWE-20: Improper Input Validation
Affected Product Github.com/containernetworking/cni
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 7.2

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required High (PR:H)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2021-20206

To remediate this vulnerability, upgrade all affected Github.com/containernetworking/cni dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/containernetworking/cni fixed: 0.8.1
Upgrade github.com/containernetworking/cni to 0.8.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/containernetworking/cni

How to Check if You Are Affected

To determine whether your application is affected by CVE-2021-20206, inspect your project dependencies for Github.com/containernetworking/cni:

inspect dependencies for github.com/containernetworking/cni

Analyze the terminal output to locate any version of Github.com/containernetworking/cni in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.8.1), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Github.com/containernetworking/cni, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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

CVE-2021-20206 Affected Github.com/containernetworking/cni Versions

1 component(s)
Fixed Versions:
0.8.1
Product / Package Ecosystem Affected Versions Fixed Version
github.com/containernetworking/cni
Go
< 0.8.1
0.8.1

References

Frequently Asked Questions

What is CVE-2021-20206?
CVE-2021-20206 is a security vulnerability in Github.com/containernetworking/cni involving containernetworking/cni improper limitation of path name under CWE-20: Improper Input Validation.
Which Github.com/containernetworking/cni versions are affected?
Affected versions include releases prior to 0.8.1 across affected packages: github.com/containernetworking/cni.
What version fixes CVE-2021-20206?
Upgrading to 0.8.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/containernetworking/cni affected?
Yes, github.com/containernetworking/cni is affected in releases prior to 0.8.1. Upgrade your dependency to 0.8.1 or later.
What is the CVSS score of CVE-2021-20206?
CVE-2021-20206 has a CVSS v3.1 base score of 7.2 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2021-20206?
CVE-2021-20206 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check Go dependencies for CVE-2021-20206?
Run the dependency tree command: 'inspect dependencies for github.com/containernetworking/cni'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-xjqr-g762-pxwp",
  "modified" : "2023-10-02T13:12:28Z",
  "published" : "2022-02-15T01:57:18Z",
  "aliases" : [ "CVE-2021-20206" ],
  "summary" : "containernetworking/cni improper limitation of path name",
  "details" : "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.\n### Specific Go Packages Affected\ngithub.com/containernetworking/cni/pkg/invoke",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/containernetworking/cni"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.8.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-20206"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/containernetworking/cni/pull/808"
  }, {
    "type" : "WEB",
    "url" : "https://bugzilla.redhat.com/show_bug.cgi?id=1919391"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/containernetworking/cni"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2022-0230"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/vuln/SNYK-GOLANG-GITHUBCOMCONTAINERNETWORKINGCNIPKGINVOKE-1070549"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20", "CWE-22" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-05-18T21:07:06Z",
    "nvd_published_at" : "2021-03-26T22:15:00Z"
  }
}