Description
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.
Published: 2026-10-20
Score: 7.1 High
EPSS: < 1% Very Low
KEV: No
Impact: Arbitrary code execution via poisoned activate.xsh scripts
Action: Immediate Patch
AI Analysis

Impact

virtualenv is a tool that creates isolated Python environments. In releases prior to 21.14.9 the component that generates POSIX xonsh activation scripts writes non‑ASCII prompt or destination data with repr() into an UTF‑8 activate.xsh file, and xonsh later parses that file using the $XONSH_ENCODING environment variable. When the system uses a legacy multibyte codec such as GBK or Big5, a UTF‑8 trail byte can consume the backslash before an adjacent quote, breaking the quoted literal and allowing attacker‑supplied content to be interpreted as executable code. This flaw is an injection vulnerability (CWE‑94) that can lead to arbitrary code execution when the user sources a compromised activate.xsh.

Affected Systems

The affected product is virtualenv from the pypa project. All releases prior to 21.14.9, including 21.14.8 and earlier, contain the flaw and are vulnerable when the environment uses a legacy multibyte encoding and the user sources the generated activate.xsh.

Risk and Exploitability

The CVSS score of 7.1 indicates a high severity, and although the EPSS score is not available, the vulnerability is not listed in the CISA KEV catalog. The attack vector is local: an attacker must supply malicious content in the activation script and the victim must source it, which typically occurs in shared or collaborative environments where the script is generated by an attacker who can set the encoding. Successful exploitation results in arbitrary code execution within the context of the activated virtual environment, potentially compromising the integrity and confidentiality of the system.

Generated by OpenCVE AI on October 20, 2026 at 22:47 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade virtualenv to version 21.14.9 or later
  • If an upgrade cannot be performed immediately, set $XONSH_ENCODING to UTF‑8 before sourcing an activate.xsh script to avoid mismatched decoding
  • Avoid sourcing activate.xsh files from untrusted or unknown sources until the fix is applied

Generated by OpenCVE AI on October 20, 2026 at 22:47 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-394h-qwmc-48pf virtualenv: Xonsh activation literals depend on the script decoding codec
History

Tue, 27 Oct 2026 14:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Wed, 21 Oct 2026 00:30:00 +0000

Type Values Removed Values Added
References
Metrics threat_severity

None

cvssV3_1

{'score': 7.0, 'vector': 'CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H'}

threat_severity

Moderate


Tue, 20 Oct 2026 21:00:00 +0000

Type Values Removed Values Added
First Time appeared Pypa
Pypa virtualenv
Vendors & Products Pypa
Pypa virtualenv

Tue, 20 Oct 2026 19:45:00 +0000

Type Values Removed Values Added
Description 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.
Title virtualenv: Xonsh activation literals depend on the script decoding codec
Weaknesses CWE-94
References
Metrics cvssV4_0

{'score': 7.1, 'vector': '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'}


cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-10-27T13:33:36.583Z

Reserved: 2026-10-20T16:03:14.863Z

Link: CVE-2026-113718

cve-icon Vulnrichment

Updated: 2026-10-27T13:33:15.664Z

cve-icon NVD

Status : Awaiting Analysis

Published: 2026-10-20T20:17:18.197

Modified: 2026-10-27T14:16:33.297

Link: CVE-2026-113718

cve-icon Redhat

Severity : Moderate

Publid Date: 2026-10-20T19:39:52Z

Links: CVE-2026-113718 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-10-20T23:00:23Z

Weaknesses
  • CWE-94

    Improper Control of Generation of Code ('Code Injection')