Skip to main content

virtualenv EUVDEUVD-2026-105273

| CVE-2026-113725 HIGH
OS Command Injection (CWE-78)
2026-10-20 GitHub_M GHSA-vxj4-q4g9-crj7
7.8
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

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

  1. Access
    Craft virtualenv name with backslash+$(...) payload
  2. Delivery
    Victim clones/receives and activates environment
  3. Exploit
    Bash PS1 double-pass undoes escaping
  4. Execution
    Command runs on each prompt redraw
  5. Impact
    Arbitrary 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.

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

virtualenv < 21.14.7

Affected Packages

pypi virtualenv fix: 21.14.7

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

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

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

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

CVSS VectorVendor: GitHub_M

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

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

Why It Matters

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.

Business Impact: Medium
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.2%
Top 96% exploitable
Prevalence
High
extremely common Python dev tool, broad developer and CI footprint
Threat Intel
1
1 source
Data Quality
6 sources
Confidence: High
EUVD NVD CVE.org EPSS GHSA Vendor GitHub VulDB

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.

CVE-2024-53899 HIGH POC
7.8 Nov 24

virtualenv before 20.26.6 allows command injection through the activation scripts for a virtual environment. Rated high

CVE-2026-102930 HIGH POC
7.7 Sep 29

virtualenv versions prior to 21.7.12 cache and seed pip/setuptools wheels without verifying their bytes, so an attacker

CVE-2026-102938 MEDIUM POC
5.8 Sep 29

Configuration injection in PyPA virtualenv before 21.7.11 lets a line boundary embedded in a prompt value inject extra k

CVE-2026-113722 HIGH
7.8 Oct 20

Command injection in PyPA virtualenv before 21.14.9 lets an attacker who controls the destination path of a virtual envi

CVE-2026-102925 HIGH
7.8 Sep 29

Command injection in the bash, zsh, and fish activation scripts generated by virtualenv releases prior to 21.7.13 lets a

CVE-2026-102937 HIGH
7.3 Sep 29

Command injection in PyPA virtualenv before 21.7.12 allows an attacker who controls the environment's prompt value - via

CVE-2026-115586 HIGH
7.1 Oct 23

Command injection in virtualenv's bash activator lets an attacker-supplied --prompt value be stored unescaped in PS1 and

CVE-2026-113723 HIGH
7.1 Oct 20

Caller-influenced prompt text in virtualenv's bash activation script prior to 21.14.9 can be re-expanded by bash as exec

CVE-2026-113718 HIGH
7.1 Oct 20

A code injection flaw in PyPA virtualenv before 21.14.9 lets attacker-influenced non-ASCII characters in the xonsh promp

CVE-2026-113724 MEDIUM
4.5 Oct 20

Symlink following in virtualenv's safe_delete() deletion-error handler (all versions prior to 21.14.9) lets a local atta

CVE-2026-113721 MEDIUM
4.5 Oct 20

Symlink-following file writes in virtualenv before 21.14.9 let a second, unprivileged local account redirect generated e

CVE-2026-113719 MEDIUM
4.5 Oct 20

Path traversal in PyPA virtualenv's seed-package cleanup lets a local, low-privileged attacker delete files outside the

Vendor StatusVendor

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