Skip to main content

virtualenv EUVDEUVD-2026-106869

| CVE-2026-113726 HIGH
OS Command Injection (CWE-78)
2026-10-20 security-advisories@github.com GHSA-5vjq-rrrf-7h2q
7.8
CVSS 3.1 · Vendor: github
View

Attack ChainAIDerived

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

  1. Access
    Craft venv name/prompt with zsh expansion payload
  2. Exploit
    Victim activates environment in zsh with PROMPT_SUBST
  3. Execution
    Unescaped value assigned to PS1 triggers expansion on redraw
  4. Impact
    Execute 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.

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

virtualenv < 21.14.4

Affected Packages

pypi virtualenv fix: 21.14.4

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

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

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.

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

Why It Matters

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.

Business Impact: Medium
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.2%
Top 86% exploitable
Prevalence
High
virtualenv is among the most widely used Python environment tools, but vulnerable config is narrower
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