Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft virtualenv name with backslash+$(...) payload
-
DeliveryVictim clones/receives and activates environment
-
ExploitBash PS1 double-pass undoes escaping
-
ExecutionCommand runs on each prompt redraw
-
ImpactArbitrary code executes as the 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 | Requires: (1) an interactive bash shell - the flaw is in bash's two-pass PS1 handling and the ZSH activator path is explicitly unaffected; (2) the prompt-setting code active, i.e. VIRTUAL_ENV_DISABLE_PROMPT is NOT set; (3) an attacker-controlled environment name or --prompt value containing a backslash before command substitution '\$(...)' or backticks; and (4) the victim actually activating that environment (UI:R). Limiting factors: exploitation is local only (no network vector), does not affect zsh users, is nullified when the prompt is disabled, and depends on the attacker influencing the env name before the victim sources activate.sh - reducing realistic risk to developer/CI targeting rather than broad exploitation. Fixed in virtualenv 21.14.7. |
| Impact | Signals are consistent and point to a moderate, developer-centric risk rather than a mass-exploitation emergency. The CVSS:3.1 vector (AV:L/AC:L/PR:N/UI:R) correctly models this as a LOCAL vulnerability requiring user interaction: an attacker cannot reach it over the network - a victim must activate a virtualenv whose name (or --prompt value) is attacker-controlled, in an interactive bash shell with the prompt enabled. The CWE-78 command-injection impact is genuine and severe once triggered (C:H/I:H/A:H - arbitrary commands run in the user's shell context on every prompt redraw), which justifies the 7.8 base score. No EPSS score, KEV listing, or public weaponized exploit was provided in the input, so there is no evidence of active exploitation; this is a high-CVSS issue whose REAL-WORLD likelihood is throttled by the UI:R/AV:L prerequisites and the need for attacker influence over an environment name. The practical exposure is supply-chain / social-engineering style (e.g., a cloned repo, project template, or automation that creates a venv with a crafted name). Note the bug is bash-specific (the ZSH path is explicitly separate in the fix), so zsh users and non-interactive use are unaffected - AV:L plus bash-only plus activation dependency means targeted developer/CI compromise, not widespread opportunistic attack. |
| Exploit ScenarioDerived | An attacker publishes a repository, project template, or setup script that creates or instructs the victim to create a virtualenv whose name or --prompt value embeds a backslash before a command substitution, e.g. 'x\$(touch PWNED)y'. When the developer activates that environment in bash, the double-pass PS1 handling undoes the escaping and the embedded command executes in their shell each time the prompt is drawn. The fix commit ships regression tests demonstrating the technique, but no standalone public exploit was reported in the input. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 20, 2026
Command injection in virtualenv's bash activation script prior to 21.14.7 allows a crafted environment name or --prompt value to execute shell commands each time bash renders the prompt. The flaw arises because the script escapes the name for only one of bash's two PS1 processing passes, so a backslash before $(...) or backticks survives as command substitution; exploitation is local and requires the victim to activate the malicious environment while prompt modification is enabled. No public exploit identified at time of analysis, and virtualenv 21.14.7 contains the vendor fix.
RemediationAI
Upgrade to virtualenv 21.14.7 or later, which escapes backslashes, dollar signs, and backticks for both bash PS1 passes per commit c3104e02474b652832a9bbaae79f6e1696296932. If upgrading immediately is not possible, set VIRTUAL_ENV_DISABLE_PROMPT=1 before activating environments to skip prompt modification - the trade-off is that the shell prompt will no longer show the active environment name. Avoid activating environments whose names or --prompt values contain backslashes, command substitution syntax, or backticks, and prefer zsh activation where feasible because that path is unaffected. Consult the vendor advisory at https://github.com/pypa/virtualenv/security/advisories/GHSA-vxj4-q4g9-crj7 for additional guidance.
Affected VersionsENISA
Affected Packages
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 generates an activate.sh script that modifies the shell prompt (PS1) to display the active environment name. Bash processes PS1 in two passes: first it decodes backslash prompt escapes such as \\ and \$, then it performs expansion, including command substitution. The vulnerable activator escaped the environment name for only one pass, so an attacker-controlled name containing a backslash before $(...) or backticks could undo the escaping and leave executable command substitution in the prompt. This is CWE-78 OS command injection, scoped to interactive bash sessions where VIRTUAL_ENV_DISABLE_PROMPT is not set; the zsh path is explicitly unaffected because it uses different prompt handling. The fix in commit c3104e02474b652832a9bbaae79f6e1696296932 escapes backslashes, dollar signs, and backticks for both bash passes, and the CPE cpe:2.3:a:pypa:virtualenv:*:*:*:*:*:*:*:* reflects an unversioned wildcard for affected releases before 21.14.7.
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
AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Local because the victim must source activate.sh in their own bash shell (UI:R); no privileges needed (PR:N), and command injection yields full user-context compromise (C/I/A:H).
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
2DescriptionCVE.org
virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.7, the bash activate script escapes the environment name for only one of the two passes bash makes over PS1, so a backslash in the name undoes the escaping and a name containing \$(...) runs as commands in the user's shell each time bash draws the prompt. This issue is fixed in version 21.14.7.
Technical POC Analysis
CWE-78 command injection, with CWE-116 also listed in the advisory, in virtualenv's bash activation template: src/virtualenv/activation/bash/activate.sh, specifically the block that prepends the envi…
Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.
Executive ViewAI
virtualenv releases prior to 21.14.7 carry a command injection flaw in the bash activation script that can let a crafted environment name or prompt value execute shell commands on a developer workstation each time the prompt renders. Exposure is concentrated in engineering, build, and CI environments where virtualenv is common, and because a victim must activate a malicious environment with prompt modification enabled, the risk is targeted rather than widespread. Leadership should care because a compromised developer endpoint can become a path into source code, credentials, and pipeline infrastructure.
Apply vendor patch.
Threat Intelligence Overview
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
OS command injection occurs when an application passes unsanitized user input directly into system shell commands.
More in Virtualenv
View allvirtualenv before 20.26.6 allows command injection through the activation scripts for a virtual environment. Rated high
virtualenv versions prior to 21.7.12 cache and seed pip/setuptools wheels without verifying their bytes, so an attacker
Configuration injection in PyPA virtualenv before 21.7.11 lets a line boundary embedded in a prompt value inject extra k
Command injection in PyPA virtualenv before 21.14.9 lets an attacker who controls the destination path of a virtual envi
Command injection in the bash, zsh, and fish activation scripts generated by virtualenv releases prior to 21.7.13 lets a
Command injection in PyPA virtualenv before 21.7.12 allows an attacker who controls the environment's prompt value - via
Command injection in virtualenv's bash activator lets an attacker-supplied --prompt value be stored unescaped in PS1 and
Caller-influenced prompt text in virtualenv's bash activation script prior to 21.14.9 can be re-expanded by bash as exec
A code injection flaw in PyPA virtualenv before 21.14.9 lets attacker-influenced non-ASCII characters in the xonsh promp
Symlink following in virtualenv's safe_delete() deletion-error handler (all versions prior to 21.14.9) lets a local atta
Symlink-following file writes in virtualenv before 21.14.9 let a second, unprivileged local account redirect generated e
Path traversal in PyPA virtualenv's seed-package cleanup lets a local, low-privileged attacker delete files outside the
EUVD-2026-105273
GHSA-vxj4-q4g9-crj7
NVD
CVE.org
EPSS
VulDB
Exploit-DB