Skip to main content

virtualenv EUVDEUVD-2026-105271

| CVE-2026-113723 HIGH
OS Command Injection (CWE-78)
2026-10-20 GitHub_M GHSA-6w3r-xr62-4xcp
7.1
CVSS 4.0 · Vendor: GitHub_M
View

Attack ChainAIDerived

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

  1. Access
    Influence prompt value passed to virtualenv
  2. Exploit
    Victim activates environment in bash
  3. Execution
    PS1 re-expansion decodes injected syntax
  4. Impact
    Arbitrary 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 $(touch PWNED) prompt payload.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

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

virtualenv < 21.14.9

Affected Packages

pypi virtualenv fix: 21.14.9

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

Vendor (GitHub_M) PRIMARY 7.1 HIGH
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
vuln.today AI 7.0 HIGH

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.

3.1 AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H
4.0 AV:L/AC:H/AT:P/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
High
Attack Requirements
Present
Privileges Required
None
User Interaction
Active
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
Patch available
Oct 20, 2026 - 21:18 EUVD
CVE Published
Oct 20, 2026 - 19:51 cve.org
HIGH 7.1

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

Why It Matters

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.

Business Impact: Medium
Compensating Controls

Apply vendor patch (virtualenv 21.14.9).

Threat Intelligence Overview

EPSS Score
0.1%
Top 97% exploitable
Prevalence
High
virtualenv is one of the most widely used Python environment tools in dev and CI
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.1%
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

36
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +36
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-113725 HIGH
7.8 Oct 20

Command injection in virtualenv's bash activation script prior to 21.14.7 allows a crafted environment name or --prompt

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