CVE-2026-113722: CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in pypa virtualenv
Description
CVE-2026-113722 is an OS command injection vulnerability in pypa virtualenv prior to version 21.14.9. The issue arises because virtualenv's ScriptMakerCustom and pip pass an incompletely quoted interpreter path to distlib ScriptMaker when generating POSIX console scripts. If the interpreter path contains spaces or results in a shebang longer than 127 bytes, distlib emits a /bin/sh wrapper with a double-quoted interpreter path that still allows command substitution and backticks to be expanded. This can allow an attacker who controls the environment destination to execute arbitrary commands with the user's privileges when the generated launcher is run. Existing launchers are not fixed by upgrading virtualenv alone and must be regenerated. The vulnerability is fixed in virtualenv version 21.14.9.
CVSS v3.1
Score 7.8high
Affected software
pypa
virtualenv
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in virtualenv (prior to 21.14.9) involves improper neutralization of special elements in OS command construction (CWE-78). Specifically, when generating POSIX console scripts, the interpreter path passed to distlib ScriptMaker is incompletely quoted. If the path contains spaces or results in a shebang longer than 127 bytes, distlib creates a /bin/sh wrapper script with a double-quoted interpreter path that still allows shell command substitutions and backticks to be expanded. An attacker who can influence the environment destination can exploit this to execute arbitrary commands with the privileges of the user running the launcher. The vulnerability does not trigger during environment creation or activation but only when the generated launcher is executed. Upgrading virtualenv to version 21.14.9 fixes the issue, but existing launchers remain vulnerable until regenerated. Additionally, pip's vendored distlib remains unchanged, so pip upgrades can reintroduce the vulnerability by generating affected launchers.
Potential Impact
Successful exploitation allows an attacker who can influence the environment destination to execute arbitrary OS commands with the privileges of the user running the generated launcher script. This can lead to full compromise of the user's environment, including confidentiality, integrity, and availability impacts. The vulnerability does not require elevated privileges to exploit but does require user interaction to run the affected launcher. Existing launchers remain vulnerable even after upgrading virtualenv, requiring regeneration. Pip upgrades can reintroduce the vulnerability.
Mitigation Recommendations
A fix for this vulnerability is available in virtualenv version 21.14.9. Users should upgrade to this version or later. However, simply upgrading virtualenv does not repair existing launchers; these must be regenerated to remove the vulnerability. Users should also be aware that pip's vendored distlib remains vulnerable, so pip upgrades or installations can reintroduce affected launchers. Therefore, after upgrading virtualenv, users should regenerate all launchers and monitor pip-related activities to avoid reintroducing the issue.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-10-20T16:03:14.863Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 6ad7c9302cdf04f656591b15
Added to database: 10/20/2026, 20:04:00 UTC
Last enriched: 10/20/2026, 20:18:20 UTC
Last updated: 10/20/2026, 20:19:54 UTC
Views: 6
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.