{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2022-21668","id":"CVE-2022-21668","title":"Pipenv's requirements.txt parsing allows malicious index url in comments","description":"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 co","descriptionLong":"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":"2022-01-10T20:20:16.000Z","updated":"2026-10-28T02:30:28.144694882Z","reserved":"2021-11-16T00:00:00.000Z","status":"Modified","rejected":false,"assigner":"GitHub_M","metric":{"version":"3.1","score":8,"vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:H","rating":"high","source":"GitHub_M"},"metrics":[{"version":"4.0","score":null,"vector":"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","rating":"high","source":"GitHub"},{"version":"3.1","score":8,"vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:H","rating":"high","source":"GitHub_M"},{"version":"3.1","score":8,"vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:H","rating":"high","source":"github.com"},{"version":"3.1","score":8.6,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H","rating":"high","source":"NVD"},{"version":"3.1","score":8,"vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:H","rating":"high","source":"OSV"},{"version":"3.1","score":8,"vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:H","rating":"high","source":"GitHub"},{"version":"2.0","score":9.3,"vector":"AV:N/AC:M/Au:N/C:C/I:C/A:C","rating":"critical","source":"NVD"}],"rating":"high","products":["pypa pipenv"],"affectedProducts":[{"vendor":"pypa","product":"pipenv","defaultStatus":null,"versions":[{"status":"affected","version":">= 2018.10.9, < 2022.1.8"}],"platforms":[]}],"packages":[{"ecosystem":"PyPI","name":"pipenv","purl":"pkg:pypi/pipenv","ranges":[">=2018.10.9 <2022.1.8"],"fixed":["2022.1.8"],"advisory":"GHSA-qc9x-gjcv-465w"}],"cwes":["CWE-20","CWE-77","CWE-78","CWE-427","CWE-791","CWE-190","CWE-1284"],"aliases":["GHSA-qc9x-gjcv-465w","PYSEC-2022-6"],"references":[{"url":"https://github.com/pypa/pipenv/security/advisories/GHSA-qc9x-gjcv-465w","tags":["x_refsource_CONFIRM","x_transferred","Exploit","Third Party Advisory","advisory","web"]},{"url":"https://github.com/pypa/pipenv/commit/439782a8ae36c4762c88e43d5f0d8e563371b46f","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix","web"]},{"url":"https://github.com/pypa/pipenv/releases/tag/v2022.1.8","tags":["x_refsource_MISC","x_transferred","Release Notes","Third Party Advisory","web"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/QHQRIWKDP3SVJABAPEXBIQPKDI6UP7G4/","tags":["vendor-advisory","x_refsource_FEDORA","x_transferred","Mailing List","advisory"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/KCROBYHUS6DKQPCXBRPCZ5CDBNQTYAWT/","tags":["vendor-advisory","x_refsource_FEDORA","x_transferred","Mailing List","advisory"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/56HBA3EOSLEDNCCBJVHE6DO34P56EOUM/","tags":["vendor-advisory","x_refsource_FEDORA","x_transferred","Mailing List","advisory"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/21xxx/CVE-2022-21668.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-21668","tags":["advisory"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/pipenv/PYSEC-2022-6.yaml","tags":["web"]},{"url":"https://github.com/pypa/pipenv","tags":["package"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/56HBA3EOSLEDNCCBJVHE6DO34P56EOUM","tags":["web"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/KCROBYHUS6DKQPCXBRPCZ5CDBNQTYAWT","tags":["web"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/QHQRIWKDP3SVJABAPEXBIQPKDI6UP7G4","tags":["web"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":true,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":null,"epss":0.03931,"epssPercentile":0.90596,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2022-21668","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-21668","ok":true,"note":"Modified"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2022-21668","ok":true,"note":"1 package"},{"name":"GitHub Advisory","url":"https://github.com/advisories/GHSA-qc9x-gjcv-465w","ok":true,"note":"GHSA-qc9x-gjcv-465w"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2022-21668","ok":true,"note":"scored 2026-11-19"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}