Skip to main content

CVE-2026-113718: CWE-94: Improper Control of Generation of Code ('Code Injection') in pypa virtualenv

0
High
VulnerabilityCVE-2026-113718cvecve-2026-113718cwe-94
Published: 10/20/2026 (10/20/2026, 19:39:52 UTC)
Source: CVE Database V5
Vendor/Project: pypa
Product: 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

Attack Vector
Local
Attack Complexity
High
Attack Requirements
Present
Privileges Required
None
User Interaction
Active
Vuln. Confidentiality
High
Vuln. Integrity
High
Vuln. Availability
High
Subsq. Confidentiality
None
Subsq. Integrity
None
Subsq. Availability
None
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

Affected software

pypa

virtualenv

Affected versions
<21.14.9
virtualenv
pkg:pypi/virtualenv
Affected versions
<21.14.9

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 10/20/2026, 20:03:15 UTC

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses