Skip to main content

PyPA virtualenv EUVDEUVD-2026-105299

| CVE-2026-113718 HIGH
Code Injection (CWE-94)
2026-10-20 GitHub_M GHSA-394h-qwmc-48pf
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 virtualenv prompt or destination path
  2. Delivery
    Non-ASCII data written via repr() to activate.xsh
  3. Exploit
    Victim sources script under GBK/Big5 xonsh
  4. Execution
    Trail byte consumes escaping backslash, literal closes
  5. Impact
    Injected statements execute in user shell

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Code injection prevention, sandbox exec
MITRE ATT&CK

2 techniques across 2 tactics: Execution, Initial Access

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Requires all of the following to coincide: (1) the target uses the xonsh shell with its POSIX activation script generated by a vulnerable virtualenv (prior to 21.14.9); (2) xonsh reads that script under a legacy multibyte codec such as GBK or Big5 via the $XONSH_ENCODING setting (non-default for most Western/UTF-8 environments); (3) the virtualenv prompt or destination path contains attacker-influenced printable non-ASCII characters positioned so a UTF-8 trail byte consumes the backslash before an adjacent quote; and (4) the victim actively sources the generated activate.xsh (UI:A). These layered requirements - specific shell, specific non-default encoding, attacker control over prompt/path data, and victim interaction - substantially limit realistic exploitation and explain the AC:H/AT:P/UI:A rating.

Impact

This is a moderate-priority, condition-dependent code injection (CWE-94) in PyPA virtualenv, not a drop-everything issue. The vendor CVSS 4.0 vector (AV:L/AC:H/AT:P/PR:N/UI:A, score 7.1) is internally consistent with the description: exploitation is local, requires a specific precondition (AT:P - a legacy multibyte codec such as GBK/Big5 set via $XONSH_ENCODING), is high-complexity (AC:H - depends on a UTF-8 trail byte consuming an escaping backslash), and needs active user interaction (UI:A - the victim must source the generated activate.xsh). No CVSS 3.1 vector, EPSS score, KEV entry, or POC was provided in the input. There is no public exploit identified at time of analysis, and the product is not in CISA KEV, so there is no evidence of active exploitation despite the HIGH confidentiality/integrity/availability impact. The gating factors (xonsh shell + non-UTF-8 legacy encoding + attacker-influenced prompt/path data + victim sourcing the script) make real-world exploitation narrow and targeted rather than widespread, which is why the raw HIGH impact should not be read as broad urgency. Missing data to note: no EPSS and no independent POC assessment are available, so exploitation likelihood is inferred from the CVSS vector and description alone.

Exploit ScenarioDerived

An attacker influences the virtualenv prompt string or destination path with crafted non-ASCII data; virtualenv's xonsh activator writes it via repr() into a UTF-8 activate.xsh. When a victim whose xonsh is configured with a legacy multibyte codec (GBK/Big5) sources that script, a UTF-8 trail byte consumes the backslash escaping an adjacent quote, closing the literal early and executing attacker-controlled statements in the victim's shell. No public exploit code was provided in the input.

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

A code injection flaw in PyPA virtualenv before 21.14.9 lets attacker-influenced non-ASCII characters in the xonsh prompt or environment destination path break out of a generated Python literal and inject statements into activate.xsh. Exploitation is highly conditional: it requires the xonsh shell, the script being read under a legacy multibyte codec such as GBK or Big5 via $XONSH_ENCODING, attacker control over the prompt or path data, and the victim actively sourcing the generated script, so realistic risk is moderate rather than urgent. The issue is fixed in 21.14.9, which writes prompt and path literals as ASCII escapes; no public exploit code was identified at time of analysis.

RemediationAI

Upgrade virtualenv to 21.14.9 or later (release tag 21.14.9; advisory GHSA-394h-qwmc-48pf). Because the fix changes script generation rather than the runtime, previously created environments keep their vulnerable activate.xsh files: re-run virtualenv (or the environment's activation script regeneration, e.g. recreating the venv) so the now-ASCII-escaped scripts are rewritten, as the upstream changelog explicitly instructs. If upgrading immediately is not possible, the practical compensating control is to keep $XONSH_ENCODING on UTF-8 (the default in most environments) so the legacy multibyte decoding path that consumes the backslash escape is never exercised - the trade-off is that any workflow genuinely requiring GBK/Big5 in xonsh remains exposed. Additionally, avoid embedding untrusted non-ASCII text in the virtualenv prompt or destination path (e.g. --prompt), since attacker-influenced characters are the injection vector; this reduces but does not eliminate exposure where paths are user-controlled. Regenerating scripts with a patched virtualenv is preferred over hand-editing activate.xsh, which will be overwritten on the next regeneration.

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 shell activation scripts from templates; for xonsh it emits a Python-parsed script (activate.xsh) and quotes prompt/path values with Python's repr(). repr() preserves printable non-ASCII characters literally in the output, so the file is written containing raw UTF-8 bytes. xonsh, however, reads the script using whatever codec $XONSH_ENCODING specifies, which can be a legacy multibyte codec like GBK or Big5. Under such a codec, a UTF-8 trail byte can pair with the following backslash byte that repr() placed before an adjacent quote, consuming the escape and letting the string literal terminate early - the same root-cause class as CWE-94 (improper control of code generation). Anything after the injected quote in attacker-influenced prompt or destination data is then parsed as xonsh/Python statements. The upstream fix (PR #3432, commit e5fc2e6e) switches XonshActivator.quote() from repr() to ascii(), so every literal is emitted as ASCII escape sequences and is independent of the encoding used to read the file; the accompanying test round-trips a string containing CJK characters and an apostrophe through GBK decoding. The CPE identifies the pypa:virtualenv package as the sole affected product family, and the CVSS 4.0 vector (AV:L/AC:H/AT:P/PR:N/UI:A) matches the assessment's CVSS 3.1 view: local attack vector, high attack complexity, no privileges required, and active user interaction.

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

Local script execution (AV:L), narrow encoding/byte-alignment precondition (AC:H), victim must source the script (UI:R); no attacker privileges needed (PR:N) and injected shell code yields full C/I/A impact.

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

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:39 cve.org
HIGH 7.1

DescriptionCVE.org

virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, POSIX xonsh activation quote() uses repr() to write printable non-ASCII prompt or destination data into UTF-8 activate.xsh, while xonsh can read that script using $XONSH_ENCODING. Under a legacy multibyte codec such as GBK or Big5, a UTF-8 trail byte can consume the backslash before an adjacent quote, allowing the literal to close and attacker-influenced statements to execute when the user sources the generated script. This issue is fixed in version 21.14.9.

Technical POC Analysis

CWE-94 (Improper Control of Generation of Code).

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

PyPA virtualenv versions before 21.14.9 contain a code injection flaw that can compromise developer environments when using the xonsh shell under legacy multibyte encodings, allowing injected statements into generated activation scripts. Exploitation is highly conditional-requiring attacker influence over prompt or path data and a victim actively sourcing the script-so leadership should prioritize targeted remediation for xonsh-using teams rather than organization-wide emergency response. The vendor has released 21.14.9 to address the issue, and no public exploit code was identified at time of analysis.

Business Impact: Medium
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.1%
Top 97% exploitable
Prevalence
High
virtualenv is a very widely deployed core Python environment tool
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.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

Code Injection CRITICAL

Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

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