# CVE-2022-21668: Pipenv's requirements.txt parsing allows malicious index url in comments

- Priority: **Prioritise**
- Reason: Public exploit (GitHub, Date unknown)
- Next step: Check applicability and the vendor advisory: no fix release is recorded here
- Status: published
- Published: 2022-01-10 · Modified: 2024-08-03
- Aliases: GHSA-qc9x-gjcv-465w, PYSEC-2022-6, UBUNTU-CVE-2022-21668
- Record: https://cvemate.com/vulnerability/CVE-2022-21668 · JSON: https://cvemate.com/vulnerability/CVE-2022-21668/json

## Description

```text
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.
```

## Signals

- CVSS: 9.3 high (v2.0, NVD) AV:N/AC:M/Au:N/C:C/I:C/A:C
- EPSS: 3.931%, percentile 90.685%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 1 (github)

## Affected

- ubuntu pipenv (Ubuntu): All versions (No fix recorded)
- fedoraproject fedora: 34 \| 35 \| 36
- pypa pipenv: ≥ 2018.10.9, \< 2022.1.8
- PyPI pipenv (PyPI): \< 439782a8ae36c4762c88e43d5f0d8e563371b46f \| ≥ 2018.10.9, \< 2022.1.8

## References

- <https://github.com/pypa/pipenv/security/advisories/GHSA-qc9x-gjcv-465w>
- <https://github.com/pypa/pipenv/commit/439782a8ae36c4762c88e43d5f0d8e563371b46f>
- <https://github.com/pypa/pipenv/releases/tag/v2022.1.8>
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/QHQRIWKDP3SVJABAPEXBIQPKDI6UP7G4/>
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/KCROBYHUS6DKQPCXBRPCZ5CDBNQTYAWT/>
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/56HBA3EOSLEDNCCBJVHE6DO34P56EOUM/>
- <https://nvd.nist.gov/vuln/detail/CVE-2022-21668>
- <https://github.com/pypa/advisory-database/tree/main/vulns/pipenv/PYSEC-2022-6.yaml>
- <https://github.com/pypa/pipenv>
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/56HBA3EOSLEDNCCBJVHE6DO34P56EOUM>
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/KCROBYHUS6DKQPCXBRPCZ5CDBNQTYAWT>
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/QHQRIWKDP3SVJABAPEXBIQPKDI6UP7G4>
- <https://ubuntu.com/security/CVE-2022-21668>
- <https://www.cve.org/CVERecord?id=CVE-2022-21668>

---

Data as of 2026-12-05T06:51:11.028Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
