CVE-2022-21668

Source
https://nvd.nist.gov/vuln/detail/CVE-2022-21668
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-21668.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2022-21668
Aliases
Downstream
Published
2022-01-10T20:20:16Z
Modified
2025-10-22T18:26:49.223088Z
Severity
  • 8.0 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:H CVSS Calculator
Summary
Pipenv's requirements.txt parsing allows malicious index url in comments
Details

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.

Database specific
{
    "cwe_ids": [
        "CWE-20",
        "CWE-427",
        "CWE-77",
        "CWE-78",
        "CWE-791"
    ]
}
References

Affected packages

Git / github.com/pypa/pipenv

Affected ranges

Type
GIT
Repo
https://github.com/pypa/pipenv
Events

Affected versions

v2018.*

v2018.10.13
v2018.10.9
v2018.11.14
v2018.11.26

v2020.*

v2020.11.15
v2020.11.4
v2020.4.1a2
v2020.4.1b1
v2020.4.1b2
v2020.5.28
v2020.6.2
v2020.8.13

v2021.*

v2021.11.15
v2021.11.23
v2021.11.5
v2021.11.5.post0
v2021.11.9
v2021.5.29