Skip to main content

virtualenv EUVDEUVD-2026-105304

| CVE-2026-113722 HIGH
OS Command Injection (CWE-78)
2026-10-20 GitHub_M GHSA-c978-59m8-c77v
7.8
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Influence virtualenv destination path
  2. Delivery
    Embed command substitution in path
  3. Exploit
    Launcher generated with /bin/sh wrapper
  4. Execution
    Victim runs generated console script
  5. Impact
    Arbitrary commands execute as user

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization OS command sanitization, avoid shell exec
MITRE ATT&CK

2 techniques across 1 tactic: Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires an attacker to influence the virtualenv environment destination path so that it (a) contains a space or tab, or produces a shebang longer than 127 bytes - which forces distlib/virtualenv to emit a /bin/sh wrapper - AND (b) contains POSIX shell command-substitution syntax such as $(...) or backticks that the double-quoted interpreter path still expands. The flaw affects only POSIX console-script launchers (Windows is explicitly excluded in the regression tests) generated by virtualenv's ScriptMakerCustom and pip seeding prior to 21.14.9. Limiting factors that reduce real-world risk: the victim must actively run a generated launcher (creation and activation do NOT trigger it), the attacker needs local control over the destination path, and the issue is confined to POSIX systems. Additionally, upgrading alone is insufficient - existing launchers must be regenerated, and a later independent pip install can reintroduce the vulnerable launcher.

Impact

All signals point to a genuine but conditionally-gated local code-execution flaw rather than a mass-exploitation emergency. The NVD CVSS 3.1 vector (AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H, base 7.8) is internally consistent with the description: exploitation is local (the attacker must influence the virtualenv destination path), requires no privileges on the target, but depends on user interaction because the injected command only fires when the victim later runs a generated console-script launcher. No EPSS score, no CISA KEV listing, and no public POC were provided in the intelligence, so exploitation status is 'no public exploit identified at time of analysis' and there is no evidence of in-the-wild abuse. The CWE-78 classification (OS command injection) aligns with the root cause - a double-quoted interpreter path in the /bin/sh wrapper that still expands $(...) and backticks. The realistic priority is moderate: this is not a remotely-triggerable network bug and the attacker must already be able to control where an environment is created (e.g. a shared build path, an attacker-controlled CI checkout directory, or a malicious project layout), which narrows it toward targeted or supply-chain scenarios rather than broad exploitation. One nuance defenders must weigh: PR:N means 'no authentication,' but practically the attacker needs write influence over the destination path, so treat the 'unauthenticated' label as a CVSS artifact rather than evidence of trivial remote abuse.

Exploit ScenarioDerived

An attacker influences the filesystem path where a virtualenv is created - for example a shared or attacker-controlled directory name on a POSIX CI runner - such that the path contains a space (or produces a shebang longer than 127 bytes) together with shell command-substitution syntax like $(...) or backticks. virtualenv/pip then generate a /bin/sh console-script launcher whose double-quoted interpreter path still expands that substitution, so when the user later invokes the launcher the injected command runs with the user's privileges. No public exploit code was identified, and neither environment creation nor activation triggers the payload - only running a generated launcher does.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Oct 20, 2026

Command injection in PyPA virtualenv before 21.14.9 lets an attacker who controls the destination path of a virtual environment execute arbitrary commands with the victim's privileges the next time the victim runs a generated POSIX console-script launcher. The flaw arises because virtualenv's ScriptMakerCustom and pip seeding pass an incompletely quoted interpreter path to distlib's ScriptMaker, which emits a /bin/sh wrapper whose double-quoted interpreter path still expands command substitutions and backticks whenever the path contains a space or tab, or yields a shebang longer than 127 bytes. No public exploit code was identified at time of analysis and the issue is not in CISA KEV; the CVSS 3.1 score is 7.8 (AV:L/AC:L/PR:N/UI:R), reflecting that the attacker needs local influence over the environment destination and the victim must manually run the launcher - environment creation and activation alone do not trigger execution.

RemediationAI

Upgrade to virtualenv 21.14.9 or later (release tag: https://github.com/pypa/virtualenv/releases/tag/21.14.9; fix PR: https://github.com/pypa/virtualenv/pull/3417; commit 2519941bed33ee0d3ac99277f67913e439e476a9). Upgrading alone is insufficient: launchers already written to disk are not repaired, so every existing environment must be deleted and recreated (or its scripts/ directory regenerated) after the upgrade, and any environment later touched by an independent pip install or upgrade should be treated as suspect again because pip's vendored distlib remains unchanged. As a compensating control where environments cannot be rebuilt immediately, inspect console scripts under <env>/bin for a '#!/bin/sh' first line followed by an '''exec' line and rewrite those wrappers by hand with a single-quoted or properly escaped interpreter path, or replace them with long-shebang-safe stubs that exec the interpreter via a fixed path; the trade-off is that hand-edited scripts break the RECORD hash bookkeeping pip uses for uninstall and integrity checks. Defensively, create environments only under directories whose absolute paths contain no spaces, tabs, backticks, '$', or parentheses - a plain path with no whitespace never triggers the shell wrapper - and restrict who can write to or rename the destination directory, since the attack requires the attacker to influence that path (CVSS AV:L). Advisory: https://github.com/pypa/virtualenv/security/advisories/GHSA-c978-59m8-c77v.

Affected VersionsENISA

virtualenv < 21.14.9

Affected Packages

pypi virtualenv fix: 21.14.9

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

virtualenv bootstraps isolated Python environments and generates console-script entry points via distlib's ScriptMaker. On POSIX, a shebang line is limited to 127 bytes and the kernel splits the interpreter token on whitespace, so distlib falls back to a portable '/bin/sh' wrapper of the form '''exec' <interpreter> "$0" "$@"''' when the interpreter path contains spaces or the shebang is too long. Prior to 21.14.9, virtualenv's ScriptMakerCustom subclass and its pip-invoke seeding path handed distlib a path that was not fully shell-quoted, so the interpreter token inside that wrapper remained subject to shell expansion - embedded $(...) sequences and backticks in a directory name were evaluated when the launcher ran. This is CWE-78 (Improper Neutralization of Special Elements used in an OS Command): untrusted data (the filesystem path) becomes part of a shell command line without adequate escaping. The upstream fix (PR #3417, commit 2519941) adds a shell_shebang helper that applies shlex.quote plus an extra backslash-escaping pass valid for both the sh reader and Python's '''...''' string parsing, routes tab-containing paths to the shell launcher, and post-processes pip-seeded scripts to rewrite affected launchers and refresh RECORD hashes. Windows launchers are explicitly out of scope - the regression tests skip the platform.

Know when Virtualenv gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (GitHub_M) PRIMARY 7.8 HIGH
AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
vuln.today AI 7.8 HIGH

Attacker must locally influence the destination path (AV:L) and the victim must later run the launcher (UI:R); no target privileges are required (PR:N), yielding full command execution as the user (C/I/A:H).

3.1 AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
4.0 AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Red Hat 7.8 HIGH

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Local
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

2
Patch available
Oct 20, 2026 - 21:18 EUVD
CVE Published
Oct 20, 2026 - 19:48 cve.org
HIGH 7.8

DescriptionCVE.org

virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, virtualenv's ScriptMakerCustom and pip pass an incompletely quoted interpreter path to distlib ScriptMaker when generating POSIX console scripts. When the path contains a space or produces a shebang longer than 127 bytes, distlib emits a /bin/sh wrapper whose double-quoted interpreter path still expands command substitutions and backticks. An attacker who influences the environment destination can therefore execute commands with the user's privileges when the user later runs a generated launcher; environment creation and activation do not trigger the command. Existing launchers are not repaired by upgrading virtualenv alone and must be regenerated, while a later independent pip installation or upgrade can reintroduce an affected launcher because pip's vendored distlib is unchanged. The virtualenv fix is released in version 21.14.9.

Technical POC Analysis

CWE-78 (OS command injection), via incomplete shell quoting of a path that becomes part of a generated script.

Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.

Executive ViewAI

Why It Matters

PyPA virtualenv - the packaging utility that underpins Python environment creation on developer laptops and CI/CD build agents - carries a command-injection flaw (CVE-2026-113722) that can let someone who influences where an environment is created run arbitrary code as the developer or build service account the next time a generated console script is launched. Exposure is concentrated in engineering and build infrastructure rather than customer-facing products, but those environments typically hold source code, package-index credentials, and deployment keys, so a single affected workstation or runner can become a route into the software supply chain. Leadership should care because remediation is currently process-based rather than a clean vendor patch, which means the risk is managed through engineering discipline and path hygiene until an upstream fix is confirmed. The issue is rated HIGH (CVSS 7.8), unauthenticated (PR:N) but local (AV:L) and dependent on victim interaction (UI:R); no public exploit code identified at time of analysis and it is not in CISA KEV.

Business Impact: High
Compensating Controls

No vendor-released patch identified at time of analysis; interim mitigations are: constrain and validate virtualenv destination paths (no spaces, tabs, backticks, $, quotes, or other shell metacharacters, and keep the resulting shebang under 127 bytes), use short canonical paths, avoid pip seeding / console-script wrappers where not needed, prefer the standard-library venv or an approved hardened wrapper, run builds in least-privilege isolated containers with no standing credentials, and monitor for anomalous launcher execution on developer and CI hosts.

Threat Intelligence Overview

EPSS Score
0.2%
Top 94% exploitable
Prevalence
High
virtualenv is among the most widely used Python developer and CI tooling
Threat Intel
1
1 source
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.2%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Small
Automatable· derived
No
Human Impact
High

Priority Score

39
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +39
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

OS command injection occurs when an application passes unsanitized user input directly into system shell commands.

CVE-2024-53899 HIGH POC
7.8 Nov 24

virtualenv before 20.26.6 allows command injection through the activation scripts for a virtual environment. Rated high

CVE-2026-102930 HIGH POC
7.7 Sep 29

virtualenv versions prior to 21.7.12 cache and seed pip/setuptools wheels without verifying their bytes, so an attacker

CVE-2026-102938 MEDIUM POC
5.8 Sep 29

Configuration injection in PyPA virtualenv before 21.7.11 lets a line boundary embedded in a prompt value inject extra k

CVE-2026-113725 HIGH
7.8 Oct 20

Command injection in virtualenv's bash activation script prior to 21.14.7 allows a crafted environment name or --prompt

CVE-2026-102925 HIGH
7.8 Sep 29

Command injection in the bash, zsh, and fish activation scripts generated by virtualenv releases prior to 21.7.13 lets a

CVE-2026-102937 HIGH
7.3 Sep 29

Command injection in PyPA virtualenv before 21.7.12 allows an attacker who controls the environment's prompt value - via

CVE-2026-115586 HIGH
7.1 Oct 23

Command injection in virtualenv's bash activator lets an attacker-supplied --prompt value be stored unescaped in PS1 and

CVE-2026-113723 HIGH
7.1 Oct 20

Caller-influenced prompt text in virtualenv's bash activation script prior to 21.14.9 can be re-expanded by bash as exec

CVE-2026-113718 HIGH
7.1 Oct 20

A code injection flaw in PyPA virtualenv before 21.14.9 lets attacker-influenced non-ASCII characters in the xonsh promp

CVE-2026-113724 MEDIUM
4.5 Oct 20

Symlink following in virtualenv's safe_delete() deletion-error handler (all versions prior to 21.14.9) lets a local atta

CVE-2026-113721 MEDIUM
4.5 Oct 20

Symlink-following file writes in virtualenv before 21.14.9 let a second, unprivileged local account redirect generated e

CVE-2026-113719 MEDIUM
4.5 Oct 20

Path traversal in PyPA virtualenv's seed-package cleanup lets a local, low-privileged attacker delete files outside the

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy