Skip to main content

CVE-2026-113722: CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in pypa virtualenv

0
High
VulnerabilityCVE-2026-113722cvecve-2026-113722cwe-78
Published: 10/20/2026 (10/20/2026, 19:48:29 UTC)
Source: CVE Database V5
Vendor/Project: pypa
Product: 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

Attack Vector
Local
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Affected software

pypa

virtualenv

Affected versions
<21.14.9
virtualenv
pkg:pypi/virtualenv
Affected versions
<21.14.9

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 10/20/2026, 20:18:20 UTC

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses