Vulnerability Name:

CVE-2022-21668 (CCN-217207)

Assigned:2021-11-16
Published:2022-01-08
Updated:2022-04-25
Summary: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.
CVSS v3 Severity:8.6 High (CVSS v3.1 Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H)
7.5 High (Temporal CVSS v3.1 Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H/E:U/RL:O/RC:C)
Exploitability Metrics:Attack Vector (AV): Local
Attack Complexity (AC): Low
Privileges Required (PR): None
User Interaction (UI): Required
Scope:Scope (S): Changed
Impact Metrics:Confidentiality (C): High
Integrity (I): High
Availibility (A): High
8.0 High (CCN CVSS v3.1 Vector: CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:H)
7.0 High (CCN Temporal CVSS v3.1 Vector: CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:H/E:U/RL:O/RC:C)
Exploitability Metrics:Attack Vector (AV): Network
Attack Complexity (AC): High
Privileges Required (PR): Low
User Interaction (UI): Required
Scope:Scope (S): Changed
Impact Metrics:Confidentiality (C): High
Integrity (I): High
Availibility (A): High
CVSS v2 Severity:9.3 High (CVSS v2 Vector: AV:N/AC:M/Au:N/C:C/I:C/A:C)
Exploitability Metrics:Access Vector (AV): Network
Access Complexity (AC): Medium
Authentication (Au): None
Impact Metrics:Confidentiality (C): Complete
Integrity (I): Complete
Availibility (A): Complete
7.1 High (CCN CVSS v2 Vector: AV:N/AC:H/Au:S/C:C/I:C/A:C)
Exploitability Metrics:Access Vector (AV): Network
Access Complexity (AC): High
Athentication (Au): Single_Instance
Impact Metrics:Confidentiality (C): Complete
Integrity (I): Complete
Availibility (A): Complete
Vulnerability Type:CWE-20
CWE-78
CWE-77
CWE-427
CWE-791
Vulnerability Consequences:Gain Access
References:Source: MITRE
Type: CNA
CVE-2022-21668

Source: XF
Type: UNKNOWN
pipenv-cve202221668-code-exec(217207)

Source: MISC
Type: Patch, Third Party Advisory
https://github.com/pypa/pipenv/commit/439782a8ae36c4762c88e43d5f0d8e563371b46f

Source: MISC
Type: Release Notes, Third Party Advisory
https://github.com/pypa/pipenv/releases/tag/v2022.1.8

Source: CCN
Type: Pipenv GIT Repository
Pipenv's requirements.txt parsing allows malicious index url in comments

Source: CONFIRM
Type: Exploit, Third Party Advisory
https://github.com/pypa/pipenv/security/advisories/GHSA-qc9x-gjcv-465w

Source: FEDORA
Type: Mailing List, Third Party Advisory
FEDORA-2022-0d007466b3

Source: FEDORA
Type: Mailing List, Third Party Advisory
FEDORA-2022-508e460384

Source: FEDORA
Type: Mailing List, Third Party Advisory
FEDORA-2022-77ce20f03a

Vulnerable Configuration:Configuration 1:
  • cpe:/a:pypa:pipenv:*:*:*:*:*:*:*:* (Version >= 2018.10.9 and < 2022.1.8)

  • Configuration 2:
  • cpe:/o:fedoraproject:fedora:34:*:*:*:*:*:*:*
  • OR cpe:/o:fedoraproject:fedora:35:*:*:*:*:*:*:*
  • OR cpe:/o:fedoraproject:fedora:36:*:*:*:*:*:*:*

  • * Denotes that component is vulnerable
    BACK
    pypa pipenv *
    fedoraproject fedora 34
    fedoraproject fedora 35
    fedoraproject fedora 36