CVEfocus › CVE database › CVE-2022-21668

CVE-2022-21668Pipenv's requirements.txt parsing allows malicious index url in comments

CVSS 8.0 HighEPSS 3.9% (higher than 91% of CVEs)Published 2022-01-10Updated 2024-08-03Assigner: GitHub_M

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.

CWE-20CWE-427CWE-77CWE-78CWE-791

What to do

Fixed builds are available from PyPI: see the table below for the fixed version per release.

Ubuntu has not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

1Fixed
1Fix pending
3Under investigation
2Will not fix

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 26.10pipenvFix pendingUBUNTU-CVE-2022-21668
Ubuntu 26.04pipenvUnder investigationUBUNTU-CVE-2022-21668
Ubuntu 25.10pipenvWill not fix
Ubuntu decided not to fix this in this release
UBUNTU-CVE-2022-21668
Ubuntu 24.04pipenvUnder investigationUBUNTU-CVE-2022-21668
Ubuntu 22.04pipenvUnder investigationUBUNTU-CVE-2022-21668
Ubuntu 20.04pipenvWill not fix
Ubuntu decided not to fix this in this release
UBUNTU-CVE-2022-21668
PyPI librarypipenvFixed2022.1.8PYSEC-2022-6

What the vendor says

As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

Vendor advisories:

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.