CVE-2021-3572: Pip Improper Input Validation Vulnerability

HIGH
Advisory Identifier: GHSA-5xp3-jfq3-5q8x
CVSS 5.7
CWE-20
Published
Advisory Summary

CVE-2021-3572 is a HIGH (CVSS 5.7) improper input validation vulnerability (CWE-20: Improper Input Validation) affecting Pip libraries in the PyPI ecosystem. The issue involves improper input validation in pip. Remediation is available by upgrading affected packages to version 21.1.

CVE-2021-3572 at a Glance

CVE Identifier CVE-2021-3572
GHSA Identifier GHSA-5xp3-jfq3-5q8x
Severity HIGH
CVSS v3.1 Base Score 5.7
CWE Classification CWE-20: Improper Input Validation
Affected Product Pip
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 5.7

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

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

How to Fix CVE-2021-3572

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

pip fixed: 21.1
pip install pip>=21.1
Verify Direct and Transitive Dependencies

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

pip show pip

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2021-3572, inspect your installed packages using pip:

pip show pip

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

Note: The pip show pip command checks currently installed packages in your active Python environment.

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 Pip, 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

A flaw was found in python-pip in the way it handled Unicode separators in git references. A remote attacker could possibly use this issue to install a different revision on a repository. The highest threat from this vulnerability is to data integrity. This is fixed in python-pip version 21.1.

CVE-2021-3572 Affected Pip Versions

1 component(s)
Fixed Versions:
21.1
Product / Package Ecosystem Affected Versions Fixed Version
pip
PyPI
< 21.1
21.1

References

Frequently Asked Questions

What is CVE-2021-3572?
CVE-2021-3572 is a security vulnerability in Pip involving Improper Input Validation in pip under CWE-20: Improper Input Validation.
Which Pip versions are affected?
Affected versions include releases prior to 21.1 across affected packages: pip.
What version fixes CVE-2021-3572?
Upgrading to 21.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pip affected?
Yes, pip is affected in releases prior to 21.1. Upgrade your dependency to 21.1 or later.
What is the CVSS score of CVE-2021-3572?
CVE-2021-3572 has a CVSS v3.1 base score of 5.7 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2021-3572?
CVE-2021-3572 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 PyPI dependencies for CVE-2021-3572?
Run the dependency tree command: 'pip show pip'. 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-5xp3-jfq3-5q8x",
  "modified" : "2024-10-11T21:24:44Z",
  "published" : "2021-11-15T17:45:01Z",
  "aliases" : [ "CVE-2021-3572" ],
  "summary" : "Improper Input Validation in pip",
  "details" : "A flaw was found in python-pip in the way it handled Unicode separators in git references. A remote attacker could possibly use this issue to install a different revision on a repository. The highest threat from this vulnerability is to data integrity. This is fixed in python-pip version 21.1.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:H/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pip"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "21.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-3572"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/pip/pull/9827"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/pip/commit/e46bdda9711392fec0c45c1175bae6db847cb30b"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2021:3254"
  }, {
    "type" : "WEB",
    "url" : "https://bugzilla.redhat.com/show_bug.cgi?id=1962856"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-5xp3-jfq3-5q8x"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/pip/PYSEC-2021-437.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/pypa/pip"
  }, {
    "type" : "WEB",
    "url" : "https://packetstormsecurity.com/files/162712/USN-4961-1.txt"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20240621-0006"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpuapr2022.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpujul2022.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-11-12T19:41:47Z",
    "nvd_published_at" : "2021-11-10T18:15:00Z"
  }
}