CVE-2022-21668
HIGH 8.6CVSS 3.1Pipenv's requirements.txt parsing allows malicious index url in comments
pipenv is a Python development workflow tool. Starting with version 2018.10.9 and prior to version 2022.1.8, a flaw in pipenv's parsing of requirements files allows an attacker to insert a specially crafted string inside a comment anywhere within a requirements.txt file, which will cause victims who use pipenv to install the requirements file to download dependencies from a package index server controlled by the attacker. By embedding malicious code in packages served from their malicious index server, the attacker can trigger arbitrary remote code execution (RCE) on the victims' systems. If an attacker is able to hide a malicious --index-url option in a requirements file that a victim installs with pipenv, the attacker can embed arbitrary malicious code in packages served from their malicious index server that will be executed on the victim's host during installation (remote code execution/RCE). When pip installs from a source distribution, any code in the setup.py is executed by the install process. This issue is patched in version 2022.1.8. The GitHub Security Advisory contains more information about this vulnerability.
- Published
- 10 Jan 2022
- Last modified
- 17 Jun 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Modified
- Weakness
- CWE-190CWE-20CWE-77
- Also known as
- GHSA-qc9x-gjcv-465wPYSEC-2022-6
- Sources
- NVDJSONOSV GHSA-qc9x-gjcv-465wJSONOSV PYSEC-2022-6JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| OSV | GitHub | CVSS 4.0 | CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:A/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H | |
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | HIGH 8.6 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H |
| NVD | security-advisories@github.com (Secondary) | CVSS 3.1 | HIGH 8.0 | CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:H |
| OSV | GitHub | CVSS 3.1 | HIGH 8.0 | CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:H |
| NVD | nvd@nist.gov (Primary) | CVSS 2.0 | HIGH 9.3 | AV:N/AC:M/Au:N/C:C/I:C/A:C |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | pypa | pipenvcpe:2.3:a:pypa:pipenv:*:*:*:*:*:*:*:* |
>= 2018.10.9, < 2022.1.8 | 2022.1.8 |
| NVD | fedoraproject | fedoracpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:* |
= 34 | |
| NVD | fedoraproject | fedoracpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:* |
= 35 | |
| NVD | fedoraproject | fedoracpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:* |
= 36 | |
| OSV | PyPI | pipenv | >= 2018.10.9, < 2022.1.8 | 2022.1.8 |
References
- https://github.com/pypa/pipenv/commit/439782a8ae36c4762c88e43d5f0d8e563371b46f · Patch, Third Party Advisory, WEB, FIX
- https://github.com/pypa/pipenv/releases/tag/v2022.1.8 · Release Notes, Third Party Advisory, WEB
- https://github.com/pypa/pipenv/security/advisories/GHSA-qc9x-gjcv-465w · Exploit, Third Party Advisory, WEB, ADVISORY
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/56HBA3EOSLEDNCCBJVHE6DO34P56EOUM/ · Mailing List
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/KCROBYHUS6DKQPCXBRPCZ5CDBNQTYAWT/ · Mailing List
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/QHQRIWKDP3SVJABAPEXBIQPKDI6UP7G4/ · Mailing List
- https://nvd.nist.gov/vuln/detail/CVE-2022-21668 · ADVISORY
- https://github.com/pypa/advisory-database/tree/main/vulns/pipenv/PYSEC-2022-6.yaml · WEB
- https://github.com/pypa/pipenv · PACKAGE
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/56HBA3EOSLEDNCCBJVHE6DO34P56EOUM · WEB
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/KCROBYHUS6DKQPCXBRPCZ5CDBNQTYAWT · WEB
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/QHQRIWKDP3SVJABAPEXBIQPKDI6UP7G4 · WEB
History
- 25 Nov 2026 20:33 UTC · NVD: first stored (published 10 Jan 2022)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 10 Jan 2022)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 12 Jan 2022)