Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessInfluence prompt value passed to virtualenv
-
ExploitVictim activates environment in bash
-
ExecutionPS1 re-expansion decodes injected syntax
-
ImpactArbitrary command execution 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 | Exploitation requires three concrete conditions: (1) the attacker must control or influence the prompt string passed into virtualenv (e.g. the --prompt value or a name that feeds it); (2) the victim must activate the generated environment using the bash POSIX activation script and cause the prompt to be drawn; and (3) the victim's bash must be in a state that re-expands PS1 after decoding prompt escapes - specifically promptvars enabled (shopt promptvars), POSIX mode (set -o posix), or an older BASH_COMPAT compatibility level. Limiting factors: it is local-only (AV:L), not triggered in zsh or POSIX shells like dash (which the activator escapes or skips), requires active user interaction (UI:A), and does not fire under default bash configurations where PS1 is not re-expanded, which is why complexity is High with an attack requirement. |
| Impact | The input supplies a CVSS 4.0 vector (CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:A/VC:H/VI:H/VA:H, base 7.1) but no EPSS score, no CISA KEV listing, and no explicit POC flag, so there is no public exploit identified at time of analysis. The signals point consistently to a hard-to-weaponize, high-impact flaw rather than a mass-exploitation priority: AV:L means it is not remotely reachable, AC:H plus AT:P indicate the attacker needs a specific precondition (the victim's bash must expand PS1 - i.e. promptvars enabled, POSIX mode, or an older BASH_COMPAT level), and UI:A means a user must actively activate the environment and draw the prompt. PR:N is accurate in the sense that the attacker needs no privileges on the target, but exploitation hinges entirely on the attacker first influencing the prompt value that is baked into the activation script. The VC/VI/VA:H triad (effectively arbitrary command execution in the victim's shell) is what keeps this a genuine 7.1 rather than a cosmetic bug, but the combination of local vector, high complexity, required user interaction, and shell-configuration dependency means real-world risk is targeted and conditional, not broad. This is a credible developer/CI-pipeline supply-chain-style concern, not an internet-facing emergency. |
| Exploit ScenarioDerived | An attacker influences the prompt text passed to virtualenv (for example, tooling or a shared project that derives the --prompt value from an attacker-controllable name) and embeds shell substitution such as $(malicious command). When a developer later activates that environment in bash and the prompt is drawn under a configuration that re-expands PS1 (promptvars on, POSIX mode, or older compatibility levels), the injected syntax executes as the developer. No public exploit is identified, though the vendor's own fix tests demonstrate the injection using a |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 20, 2026
Caller-influenced prompt text in virtualenv's bash activation script prior to 21.14.9 can be re-expanded by bash as executable shell syntax, so a crafted --prompt value (or an environment name feeding it) can run arbitrary commands in the victim's shell when the environment is activated and the prompt is drawn. The flaw is local and interaction-dependent: the attacker must first supply the prompt string, the victim must source bin/activate under bash and cause a redraw, and bash must be in a state that re-expands PS1 (promptvars enabled, POSIX mode, or an older BASH_COMPAT level) - zsh and POSIX shells such as dash are not affected. The project shipped a fix in 21.14.9 via upstream PR #3418 and commit 5f48d711; there is no EPSS score, no CISA KEV listing, and no public exploit identified at time of analysis, and the CVSS 4.0 vector (7.1, AV:L/AC:H/AT:P/PR:N/UI:A) reflects that high preconditions bar.
RemediationAI
Vendor-released patch: 21.14.9 - upgrade virtualenv (pip install --upgrade 'virtualenv>=21.14.9' or pin the release from https://github.com/pypa/virtualenv/releases/tag/21.14.9) and then re-run the activator for any existing environment, because the vulnerable logic lives in the generated bin/activate script rather than in a runtime library; regenerating an environment or recreating it from its requirements file is the reliable way to pick up the corrected prompt handling described in https://github.com/pypa/virtualenv/pull/3418. Until every environment is regenerated, set VIRTUAL_ENV_DISABLE_PROMPT=1 before sourcing bin/activate (side effect: the environment prefix disappears from the prompt, losing the visual cue of the active environment) or strip/rewrite the PS1 block in existing activate scripts. Never pass attacker-influenced text to --prompt, and avoid creating environments in directories whose names come from untrusted sources since the directory name is the default prompt source. Shell-side hardening - keeping shopt promptvars enabled and refraining from set -o posix in interactive shells, and preferring zsh or a POSIX shell where the affected bash branch is skipped - reduces exposure but does not repair environments already generated by a vulnerable version, so treat the upgrade plus environment regeneration as the only complete fix. Consult the full advisory at https://github.com/pypa/virtualenv/security/advisories/GHSA-6w3r-xr62-4xcp for the maintainers' guidance and the commit https://github.com/pypa/virtualenv/commit/5f48d711731311428aebfae61d46957762155b22 for the exact code change.
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 a per-environment POSIX activation script (src/virtualenv/activation/bash/activate.sh) that prepends the environment name or the user-supplied --prompt value - exported as VIRTUAL_ENV_PROMPT - into PS1. Because bash performs a two-pass treatment of PS1 (first decoding backslash prompt escapes such as \\ and \$, then, when promptvars is enabled or the shell is in POSIX mode, expanding the result as a parameter/command substitution), any literal $, backtick or backslash surviving into the decoded prompt can be evaluated as shell code on every redraw. The pre-21.14.9 code attempted to escape those characters for every configuration, but the escaping was calibrated for a single expansion model and broke down under non-default bash states (shopt -u promptvars with BASH_COMPAT levels, or POSIX mode), which is the root cause class CWE-78 (Improper Neutralization of Special Elements used in an OS Command). The upstream fix removes the fragile double-escaping entirely: when bash has promptvars or posix mode active, the activator writes PS1='(${VIRTUAL_ENV_PROMPT-}) ' so the variable value is referenced, never inlined into the prompt that bash re-expands; in all other shells only backslashes are doubled (plus $, `, and % escaping handled for zsh's PROMPT_SUBST), POSIX shells like dash are left untouched to avoid 'Bad substitution' errors, and unset BASH_VERSION/ZSH_VERSION now leaves PS1 unchanged while VIRTUAL_ENV_PROMPT remains available for custom prompts.
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
CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Attacker-controlled prompt value runs locally only when the victim activates and draws the prompt in a re-expanding bash, so AV:L/AC:H/UI:R; code runs as the user with no privilege needed, giving PR:N and 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.9, caller-supplied prompt text can become executable syntax in the bash activation prompt. An attacker must influence the value passed to virtualenv, and a user must subsequently activate the environment and draw the prompt. This vulnerability is fixed in 21.14.9.
Technical POC Analysis
CWE-78 (OS command injection).
Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.
Executive ViewAI
virtualenv's bash activation script in releases prior to 21.14.9 can execute arbitrary commands in a developer's interactive shell when a crafted prompt string is re-expanded at activation, creating a local code-execution risk on engineering workstations. Exploitation requires an attacker to first supply the prompt value and the victim to source bin/activate under a bash configuration that re-expands PS1, so the practical blast radius is limited, but the affected population - developers holding source-code, CI/CD, and cloud credentials - is high-value. Leadership should care because a compromised developer shell can pivot into repositories, build pipelines, and production environments.
Apply vendor patch (virtualenv 21.14.9).
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 virtualenv's bash activation script prior to 21.14.7 allows a crafted environment name or --prompt
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
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-105271
GHSA-6w3r-xr62-4xcp
NVD
CVE.org
EPSS
Exploit-DB