RCE in Pypa Pipenv
CVE-2022-21668
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.
Vulnerability class: Drupalgeddon 2 (CVE-2018-7600)
Published · last modified .
CVSS v3 metric
CVSS v3 base score 8.0 (High). Vector: CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:H.
EPSS exploit prediction
EPSS 0.039, 90.5th percentile (scored ); unchanged over 30 days. About EPSS.
Affected products
- Pypa Pipenv — versions >= 2018.10.9, < 2022.1.8
- Fedoraproject Fedora — versions 34, 35, 36
Weakness classification (CWE)
Public exploits and proof-of-concept code
1 public repository with exploit or proof-of-concept code for this CVE:
- sreeram281997/CVE-2022-21668-Pipenv-RCE-vulnerability (1 star, last pushed 2022-03-27)
Also mentioned in 14 other repositories (ARPSyndicate/cvemon, bigpick/cve-reading-list, jacksont432/hello_world_python, …). These reference the CVE in a list, notes or a scanner and are not exploit code for it.
References
- github.com/pypa/pipenv/security/advisories/GHSA-qc9x-gjcv-465w (Exploit, Third Party Advisory)
- github.com/pypa/pipenv/commit/439782a8ae36c4762c88e43d5f0d8e563371b46f (Patch, Third Party Advisory)
- github.com/pypa/pipenv/releases/tag/v2022.1.8 (Third Party Advisory, Release Notes)
- FEDORA-2022-77ce20f03a (vendor-advisory, Mailing List)
- FEDORA-2022-508e460384 (vendor-advisory, Mailing List)
- FEDORA-2022-0d007466b3 (vendor-advisory, Mailing List)
This CVE has public exploit evidence. See the latest CVEs with public exploits.