Skip to main content

virtualenv EUVDEUVD-2026-106866

| CVE-2026-113732 HIGH
OS Command Injection (CWE-78)
2026-10-20 security-advisories@github.com GHSA-c947-3pg5-gm8q
7.8
CVSS 3.1 · Vendor: github
View

Attack ChainAIDerived

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

  1. Access
    Influence venv path or prompt value
  2. Delivery
    Inject backslash-quote command-substitution payload
  3. Exploit
    virtualenv generates activate.fish via POSIX quote
  4. Execution
    User sources activate.fish in fish
  5. Persist
    Fish executes command substitution
  6. Impact
    Arbitrary 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 source bin/activate.fish, the smuggled fish command substitution executes arbitrary commands as that user. The vendor fix commit demonstrates the exact technique, so the method is public even though no packaged exploit was reported.

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 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

virtualenv < 21.14.2

Affected Packages

pypi virtualenv fix: 21.14.2

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

Vendor (github) 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

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.

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).

CVSS VectorVendor: github

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 - 23:20 EUVD
CVE Published
Oct 20, 2026 - 22:19 cve.org
HIGH 7.8

DescriptionCVE.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

Why It Matters

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.

Business Impact: Medium
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.2%
Top 89% exploitable
Prevalence
High
virtualenv is a ubiquitous Python dev tool, but fish-activator exposure is a subset
Threat Intel
1
1 source
Data Quality
6 sources
Confidence: High

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
Defer
Exploitation· derived
None
System Exposure· derived
Small
Automatable· derived
No
Human Impact
Medium

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.

More in Python

View all
CVE-2025-24016 CRITICAL POC
9.9 Feb 10

Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t

CVE-2025-27520 CRITICAL POC
9.8 Apr 04

BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser

CVE-2025-2945 CRITICAL POC
9.9 Apr 03

pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi

CVE-2013-5093 MEDIUM POC
6.8 Sep 27

The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python

CVE-2025-32375 CRITICAL POC
9.8 Apr 09

BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica

CVE-2014-0224 HIGH POC
7.4 Jun 05

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

CVE-2024-21644 HIGH POC
7.5 Jan 08

pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.

CVE-2026-33017 CRITICAL POC
9.3 Mar 17

Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301

CVE-2017-9462 HIGH POC
8.8 Jun 06

In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse

CVE-2026-49869 CRITICAL POC
10.0 Jun 26

Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2024-21645 MEDIUM POC
5.3 Jan 08

pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne

Vendor StatusVendor

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