PyPi: Pipenv

CVE-2022-21668

Safety vulnerability ID: 44492

This vulnerability was reviewed by experts

The information on this page was manually curated by our Cybersecurity Intelligence Team.

Created at Jan 10, 2022 Updated at Jan 22, 2025
Scan your Python projects for vulnerabilities →

Advisory

Pipenv 2022.1.8 includes a fix for CVE-2022-21668: 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.
https://github.com/pypa/pipenv/security/advisories/GHSA-qc9x-gjcv-465w

Affected package

pipenv

Latest version: 2024.4.1

Python Development Workflow for Humans.

Affected versions

Fixed versions

Vulnerability changelog

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. See CVE-2022-21668.


CONFIRM:https://github.com/pypa/pipenv/security/advisories/GHSA-qc9x-gjcv-465w: https://github.com/pypa/pipenv/security/advisories/GHSA-qc9x-gjcv-465w
MISC:https://github.com/pypa/pipenv/commit/439782a8ae36c4762c88e43d5f0d8e563371b46f: https://github.com/pypa/pipenv/commit/439782a8ae36c4762c88e43d5f0d8e563371b46f
MISC:https://github.com/pypa/pipenv/releases/tag/v2022.1.8: https://github.com/pypa/pipenv/releases/tag/v2022.1.8

Resources

Use this package?

Scan your Python project for dependency vulnerabilities in two minutes

Scan your application

Severity Details

CVSS Base Score

HIGH 8.6

CVSS v3 Details

HIGH 8.6
Attack Vector (AV)
LOCAL
Attack Complexity (AC)
LOW
Privileges Required (PR)
NONE
User Interaction (UI)
REQUIRED
Scope (S)
CHANGED
Confidentiality Impact (C)
HIGH
Integrity Impact (I)
HIGH
Availability Availability (A)
HIGH

CVSS v2 Details

HIGH 9.3
Access Vector (AV)
NETWORK
Access Complexity (AC)
MEDIUM
Authentication (Au)
NONE
Confidentiality Impact (C)
COMPLETE
Integrity Impact (I)
COMPLETE
Availability Impact (A)
COMPLETE