Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessInfluence venv path or prompt value
-
DeliveryInject backslash-quote command-substitution payload
-
Exploitvirtualenv generates activate.fish via POSIX quote
-
ExecutionUser sources activate.fish in fish
-
PersistFish executes command substitution
-
ImpactArbitrary code runs 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 ALL of: (1) the victim uses the fish shell and sources the generated bin/activate.fish; (2) the attacker controls or influences the virtual environment directory path, the --prompt argument, or the VIRTUALENV_PROMPT environment variable; and (3) that attacker-controlled value contains a backslash immediately before a quote, which prematurely terminates the fish single-quoted literal and injects fish command substitution. The flaw exists specifically because FishActivator reused ViaTemplateActivator.quote()/shlex.quote(), which is POSIX-correct but unsafe for fish's distinct backslash and single-quote escaping. Limiting factors: no effect on bash/zsh/other activators, no impact for fish users who never source a maliciously-named/prompted environment, requires local user interaction (sourcing), and is remediated entirely by upgrading to virtualenv 21.14.2. No special condition applies to default configs where the venv path and prompt are fully operator-controlled and untrusted input never reaches them. |
| Impact | This is a genuine but conditionally-gated code-injection flaw (CWE-78) rather than a mass-exploitable remote vulnerability. The provided 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 (AV:L) and requires the victim to source the generated activate.fish (UI:R), with no attacker privileges needed (PR:N) and full compromise of the user's account context (C:H/I:H/A:H). No EPSS score, CISA KEV entry, or standalone public exploit is present in the supplied intelligence, so there is no evidence of active or widespread exploitation - this signal set points to a high-CVSS-but-low-immediate-real-world-risk issue whose impact is bounded by three conditions that must coincide: the victim uses the fish shell, the attacker can influence the environment directory name, --prompt, or VIRTUALENV_PROMPT, and the victim activates the environment. The one amplifying signal is that the vendor's own fix commit ships a working regression payload (x\'$(touch PWNED)'\'), so a functional exploit technique is effectively public even though no POC was flagged in the input - treat weaponization as low-effort for an attacker who can seed a malicious directory/prompt. Overall: a real priority for fish-shell users in automation/CI contexts that build virtualenvs from untrusted names, but not an internet-facing emergency. |
| Exploit ScenarioDerived | An attacker who can influence a directory name, the --prompt argument, or the VIRTUALENV_PROMPT value (for example via a CI job, a cloned repo, or an archive that dictates the venv path) embeds a backslash-before-quote sequence that breaks out of the generated fish single-quoted literal. When a fish-shell user later runs |
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 fish-shell activator allows an attacker who controls the environment directory path, the --prompt argument, or the VIRTUALENV_PROMPT variable to escape the single-quoted fish literal in the generated activate.fish and execute arbitrary commands when the victim sources that file. All virtualenv releases prior to 21.14.2 that emit a fish activator are affected; bash, zsh and other activators are not. Exploitation requires local user interaction (sourcing the file) and a crafted value containing a backslash immediately before a quote, so this is a conditionally gated local code-injection flaw rather than a remotely reachable issue; no public exploit code or CISA KEV entry was identified at time of analysis, and the vendor-released fix is version 21.14.2.
RemediationAI
Upgrade to virtualenv 21.14.2 or later (for example pip install --upgrade "virtualenv>=21.14.2"); this is a vendor-released patch and the only complete fix, described in the GitHub advisory GHSA-c947-3pg5-gm8q and the release notes at https://github.com/pypa/virtualenv/releases/tag/21.14.2. Upgrading the tool alone does not rewrite scripts already on disk, so regenerate or delete and recreate any existing environment whose bin/activate.fish was produced by an older version, or manually inspect those files for backslash-quote sequences before sourcing them. If upgrading is not immediately possible, generate environments without the fish activator (for example --activators bash,zsh) so no activate.fish is written - the trade-off is that fish users lose the convenient activation script and must activate manually. Additionally, avoid creating environments from attacker-influenced directory names or passing untrusted values to --prompt or VIRTUALENV_PROMPT, since those values are the injection vehicle; this reduces exposure but does not fix the underlying escaping bug and depends entirely on operator discipline.
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 shell-specific activation scripts via activator classes, and FishActivator inherits its quoting routine from ViaTemplateActivator.quote(), which delegates to Python's shlex.quote(). shlex.quote() produces POSIX-shell-correct single-quoted strings, but fish is not POSIX sh: inside fish single quotes, backslash is still an escape character, so a sequence such as \' ends the literal early and lets the remainder of the string be interpreted as fish syntax, including command substitution $(...). Because the quoted values written into activate.fish include the virtual environment path and the prompt string, any of those inputs that carries a backslash-before-quote payload yields injected commands that run under the victim's privileges at source time. This is CWE-78 (OS command injection), reachable with AV:L/PR:N/UI:R and high confidentiality, integrity and availability impact since the code executes as the local user. The upstream fix (commit 3bddeaf8d02c3ee7f576503efb082f8f494cfcab, released in 21.14.2) overrides quote() in FishActivator to escape backslashes first and then single quotes, and adds regression tests that run fish against payload prompt names and payload directory names to confirm no command substitution fires. No CPE data was supplied in the input; the affected package range is taken from the EUVD record (virtualenv < 21.14.2) and the vendor release tag.
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
Code runs only when the user sources the local activate.fish (AV:L, UI:R); no attacker privileges are needed (PR:N) and execution yields full user-context compromise (C:H/I:H/A:H), scope unchanged.
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.14.2, FishActivator inherits ViaTemplateActivator.quote(), which uses POSIX shlex.quote() even though fish interprets backslashes and single quotes differently. An attacker-influenced environment path, --prompt, or VIRTUALENV_PROMPT value containing a backslash before a quote can therefore terminate the generated fish literal and execute command substitution when the user sources activate.fish. This issue is fixed in version 21.14.2.
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 releases before 21.14.2 expose fish-shell users to local command injection through crafted environment paths or prompt values, potentially enabling arbitrary code execution on developer workstations when activate.fish is sourced. Although exploitation requires local interaction and a specific crafted value, compromise of developer environments could affect build integrity and access to source code, so security management should prioritize remediation across engineering and CI/CD teams.
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-106866
GHSA-c947-3pg5-gm8q
NVD
CVE.org
EPSS
Exploit-DB