CVE-2022-21668
Python vulnerability analysis and mitigation

Overview

CVE-2022-21668 affects pipenv, a Python development workflow tool, from version 2018.10.9 to version 2021.11.23. The vulnerability was discovered in January 2022 and patched in version 2022.1.8. The flaw exists in pipenv's parsing of requirements files, which allows an attacker to insert specially crafted strings inside comments within a requirements.txt file (GitHub Advisory).

Technical details

The vulnerability stems from a flaw in the parse_indexes() function of the pipenv.utils module, which incorrectly processes --index-url, --extra-index-url, and --trusted-host options. The function fails to ignore these options when they appear in comments and doesn't validate that these options appear on their own lines as required by the requirements file specification. The vulnerability has a CVSS v3.1 base score of 8.6 HIGH (AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H) according to NVD, while GitHub rates it at 8.0 HIGH (CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:H) (NVD, GitHub Advisory).

Impact

If successfully exploited, an attacker can cause victims using pipenv to download dependencies from a malicious package index server controlled by the attacker. When pip installs from a source distribution, any code in the setup.py is executed by the install process, enabling arbitrary remote code execution (RCE) on the victim's system. Attackers could potentially steal credentials, mine cryptocurrency, install malware, or gain persistent access to the victim's system (GitHub Advisory).

Mitigation and workarounds

The vulnerability has been patched in pipenv version 2022.1.8. Users should upgrade to this version or later to mitigate the risk. The fix includes changes to properly handle requirements file parsing and validation of index options (GitHub Release, GitHub Patch).

Community reactions

The vulnerability was addressed promptly by the pipenv maintainers and received attention from various Linux distributions. Fedora released security updates for versions 34, 35, and 36 to address the vulnerability (Fedora 34, Fedora 35, Fedora 36).

Additional resources


SourceThis report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-5882-5rx9-xgxpCRITICAL10
  • PythonPython
  • crawl4ai
NoYesJan 16, 2026
CVE-2026-23949HIGH8.6
  • PythonPython
  • jaraco.context
NoYesJan 20, 2026
GHSA-vx9w-5cx4-9796HIGH8.6
  • PythonPython
  • crawl4ai
NoYesJan 16, 2026
CVE-2026-23535HIGH8
  • PythonPython
  • wlc
NoYesJan 16, 2026
CVE-2026-23490HIGH7.5
  • PythonPython
  • fence-agents-intelmodular
NoYesJan 16, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management