Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft venv name/prompt with zsh expansion payload
-
ExploitVictim activates environment in zsh with PROMPT_SUBST
-
ExecutionUnescaped value assigned to PS1 triggers expansion on redraw
-
ImpactExecute arbitrary commands 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 ALL of: (1) the victim uses zsh as their interactive shell; (2) the zsh PROMPT_SUBST option is enabled (not zsh's default, but commonly set by frameworks such as oh-my-zsh or in custom .zshrc configs); (3) the attacker controls the virtual environment's directory name, the virtualenv --prompt argument, or the VIRTUALENV_PROMPT environment variable, and populates it with command, parameter, or arithmetic expansion syntax; and (4) the victim activates that environment, causing the prompt to be drawn. Limiting factors that reduce real-world risk: bash is NOT affected (it already received escaping via the BASH_VERSION guard), plain zsh with PROMPT_SUBST disabled is NOT affected, a bare percent sign only triggers prompt escapes rather than command execution, and the attack needs a local victim to activate an attacker-influenced environment (UI:R, AV:L). |
| Impact | CVSS 3.1 scores this 7.8 (HIGH) with vector AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H, reflecting arbitrary command execution in the victim's shell (full C/I/A) but gated behind local access and required user interaction. The real-world risk is meaningfully lower than the 7.8 headline because exploitation is conditional: it only affects zsh users who have PROMPT_SUBST enabled (not zsh's default, though frameworks like oh-my-zsh and many custom configs set it), and the attacker must influence the environment directory name, the --prompt argument, or VIRTUALENV_PROMPT. bash and plain zsh without PROMPT_SUBST are explicitly unaffected. No EPSS score was provided in the input and the CVE is not listed in CISA KEV, so there is no signal of active or widespread exploitation; exploitation status is best characterized as no public exploit identified, although the vendor's fix commit ships test payloads (e.g. x${$(touch PWNED)}y) that demonstrate the mechanism. No SSVC decision data was supplied. Net: this is a legitimate code-execution flaw in a ubiquitous developer tool, but the local vector, user-interaction requirement, and non-default shell configuration make it a prioritize-for-patching rather than emergency-response issue, most relevant to supply-chain/shared-environment scenarios. |
| Exploit ScenarioDerived | An attacker distributes a Python project, template, or pre-named virtual environment (or influences VIRTUALENV_PROMPT / the --prompt value) whose environment name embeds zsh expansion syntax such as x${$(touch PWNED)}y. When a victim running zsh with PROMPT_SUBST activates the environment, the unescaped name is assigned to PS1 and the expansion executes attacker commands each time the prompt is drawn. No public exploit is identified at time of analysis, though the vendor's regression tests demonstrate the payload; the local vector and required activation (UI:R) mean the victim must take action against an attacker-supplied artifact. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 21, 2026
Command injection in virtualenv's activation script allows an attacker who controls the virtual environment name (directory name, the --prompt argument, or the VIRTUALENV_PROMPT variable) to execute arbitrary commands in a victim's zsh shell each time the prompt is redrawn. Affected are virtualenv releases prior to 21.14.4; from 21.13.0 through 21.14.3 the PS1 escaping logic only ran when BASH_VERSION was set, leaving zsh with the raw, unescaped prompt value, and earlier releases left the environment name unescaped entirely. Exploitation requires a zsh interactive shell with the PROMPT_SUBST option enabled and a local victim activating the crafted environment (CVSS 3.1 7.8, AV:L/UI:R/PR:N), so unauthenticated remote exploitation is not possible; bash and default zsh configurations without PROMPT_SUBST are not affected, and no public exploit has been identified at time of analysis.
RemediationAI
Upgrade virtualenv to 21.14.4 or later (vendor-released patch: 21.14.4), available at https://github.com/pypa/virtualenv/releases/tag/21.14.4; the underlying fix is commit https://github.com/pypa/virtualenv/commit/5b915367da82bd024b2a0d28d2f98007034b4aa2, which applies escaping under both bash and zsh and doubles percent signs for zsh. Because existing environments embed a copy of the activate script generated at creation time, upgrading the virtualenv package alone is not sufficient: virtual environments must be recreated (or their bin/activate regenerated) with 21.14.4 so the corrected script is installed. Where upgrading or recreating is not immediately possible, mitigations with their trade-offs are: unset the PROMPT_SUBST option in .zshrc (removes command substitution in prompts entirely, which breaks themes and prompt frameworks that depend on it, such as parts of oh-my-zsh), avoid activating environments whose directory name, --prompt value, or VIRTUALENV_PROMPT content comes from untrusted input and strip $, backtick, backslash, and ${...} sequences from those names before creation, manually overwrite PS1 immediately after activation with a literal prompt string, or use bash for activation since bash already received the escaping. Review the advisory at https://github.com/pypa/virtualenv/security/advisories/GHSA-5vjq-rrrf-7h2q for the vendor's 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 POSIX shell activation scripts, including src/virtualenv/activation/bash/activate.sh, which bash sources directly and zsh also sources when a user activates an environment under zsh. That script assigns the environment's display name to the PS1 prompt variable. Both bash and zsh re-expand PS1 on every prompt draw: bash performs backslash, dollar-sign, and backtick substitution, and zsh performs parameter, command, and arithmetic expansion when the PROMPT_SUBST option is enabled. This is CWE-78 (improper neutralization of special elements used in an OS command): the prompt value is written into a shell-expanded context without adequate escaping. The upstream fix (commit 5b915367) broadens the guard from [ -n "${BASH_VERSION-}" ] to [ -n "${BASH_VERSION-}${ZSH_VERSION-}" ] so zsh also receives backslash/dollar/backtick escaping, and adds a zsh-specific doubling of percent signs (_VIRTUAL_PROMPT="${_VIRTUAL_PROMPT//\%/%%}") because zsh interprets % sequences as prompt escapes. The accompanying tests now render the prompt through both bash (${PS1@P}) and zsh (setopt prompt_subst; ${(%)${(e)PS1}}) and cover payloads such as x${$(touch PWNED)}y, confirming the injection hinges on zsh's PROMPT_SUBST expansion of the PS1 value rather than on a flaw in environment creation itself.
Know when Python 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 shell activation (AV:L) of an attacker-supplied env name needs no prior privileges (PR:N) but requires the victim to activate it (UI:R); resulting arbitrary command execution yields full C/I/A.
Primary rating from Vendor (github).
CVSS VectorVendor: github
Lifecycle Timeline
2DescriptionCVE.org
virtualenv is a tool for creating isolated virtual python environments. Prior to 21.13.0, the bash activate script that zsh also sources leaves the environment name unescaped; from 21.13.0 until 21.14.4, it escapes backslashes, dollar signs, and backticks only when BASH_VERSION is set, so zsh receives the raw value. The script assigns that value to PS1. In zsh with PROMPT_SUBST, an attacker-influenced environment directory, --prompt, or VIRTUALENV_PROMPT value containing command, parameter, or arithmetic expansion syntax can therefore execute commands in the user's shell each time the prompt is drawn. A percent sign is separately interpreted as a zsh prompt escape but does not by itself execute commands. Plain zsh with PROMPT_SUBST disabled and bash are not affected by this mechanism. This issue is fixed in version 21.14.4.
Technical POC Analysis
CWE-78 (OS command injection; the advisory also tags CWE-116, improper escaping of output).
Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.
Executive ViewAI
virtualenv versions prior to 21.14.4 contain a command injection flaw in activation scripts that can execute arbitrary commands on developer workstations running zsh with PROMPT_SUBST enabled, triggered when a user activates an environment whose name or prompt is attacker-controlled. The issue is high severity but requires local interaction and a specific shell configuration, so risk is concentrated in engineering teams using zsh and untrusted environment names; leadership should prioritize patching developer tooling because compromise could lead to unauthorized code execution and credential exposure on developer or build machines.
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.
Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t
BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser
pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi
The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python
BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica
OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph
pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.
Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301
In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse
Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to
Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/
pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne
EUVD-2026-106869
GHSA-5vjq-rrrf-7h2q
NVD
CVE.org
EPSS
Exploit-DB