Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessInfluence virtualenv prompt or destination path
-
DeliveryNon-ASCII data written via repr() to activate.xsh
-
ExploitVictim sources script under GBK/Big5 xonsh
-
ExecutionTrail byte consumes escaping backslash, literal closes
-
ImpactInjected 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. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – 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
Affected Packages
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
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
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.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
2DescriptionCVE.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
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.
Apply vendor patch.
Threat Intelligence Overview
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
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.
More in Virtualenv
View allvirtualenv before 20.26.6 allows command injection through the activation scripts for a virtual environment. Rated high
virtualenv versions prior to 21.7.12 cache and seed pip/setuptools wheels without verifying their bytes, so an attacker
Configuration injection in PyPA virtualenv before 21.7.11 lets a line boundary embedded in a prompt value inject extra k
Command injection in PyPA virtualenv before 21.14.9 lets an attacker who controls the destination path of a virtual envi
Command injection in virtualenv's bash activation script prior to 21.14.7 allows a crafted environment name or --prompt
Command injection in the bash, zsh, and fish activation scripts generated by virtualenv releases prior to 21.7.13 lets a
Command injection in PyPA virtualenv before 21.7.12 allows an attacker who controls the environment's prompt value - via
Command injection in virtualenv's bash activator lets an attacker-supplied --prompt value be stored unescaped in PS1 and
Caller-influenced prompt text in virtualenv's bash activation script prior to 21.14.9 can be re-expanded by bash as exec
Symlink following in virtualenv's safe_delete() deletion-error handler (all versions prior to 21.14.9) lets a local atta
Symlink-following file writes in virtualenv before 21.14.9 let a second, unprivileged local account redirect generated e
Path traversal in PyPA virtualenv's seed-package cleanup lets a local, low-privileged attacker delete files outside the
EUVD-2026-105299
GHSA-394h-qwmc-48pf
NVD
CVE.org
EPSS
VulDB
Exploit-DB