CVE-2021-3572: Pip Improper Input Validation Vulnerability
HIGHCVE-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
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).
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 install pip>=21.1
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
CVE-2021-3572 Affected Pip Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
pip
|
PyPI |
< 21.1
|
21.1
|
References
Frequently Asked Questions
What is CVE-2021-3572?
Which Pip versions are affected?
What version fixes CVE-2021-3572?
Is pip affected?
What is the CVSS score of CVE-2021-3572?
What CWE is associated with CVE-2021-3572?
How can I check PyPI dependencies for CVE-2021-3572?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}