CVE-2026-113718: CWE-94: Improper Control of Generation of Code ('Code Injection') in pypa virtualenv
Description
CVE-2026-113718 is a code injection vulnerability in pypa virtualenv versions prior to 21.14.9. It arises from improper handling of non-ASCII prompt or destination data in the POSIX xonsh activation script, where UTF-8 encoded data is written using repr() into activate.xsh. Under legacy multibyte codecs like GBK or Big5, this can allow an attacker to manipulate the script to execute arbitrary code when sourced. The issue is fixed in version 21.14.9.
CVSS v4.0
Score 7.1high
Affected software
pypa
virtualenv
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in virtualenv occurs because the POSIX xonsh activation script uses repr() to write non-ASCII data into activate.xsh in UTF-8 encoding. When the script is read under legacy multibyte codecs such as GBK or Big5, a UTF-8 trail byte can consume the backslash before an adjacent quote, prematurely closing the literal and enabling execution of attacker-controlled statements. This improper control of code generation (CWE-94) can lead to code injection when the user sources the generated script. The vulnerability is resolved in virtualenv version 21.14.9.
Potential Impact
An attacker able to influence the prompt or destination data can craft input that leads to execution of arbitrary code when the user sources the activate.xsh script under certain legacy multibyte encodings. This can result in code injection with potentially high impact on the affected system. The CVSS 4.0 score is 7.1 (high severity), reflecting local attack vector, high complexity, partial user interaction, and high impact on confidentiality, integrity, and availability.
Mitigation Recommendations
This vulnerability is fixed in virtualenv version 21.14.9. Users should upgrade to version 21.14.9 or later to remediate this issue. No other vendor advisories or temporary mitigations are provided.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-10-20T16:03:14.863Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 6ad7c5ba2cdf04f656576207
Added to database: 10/20/2026, 19:49:14 UTC
Last enriched: 10/20/2026, 20:03:15 UTC
Last updated: 10/20/2026, 20:08:21 UTC
Views: 7
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.