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.
OpenCVE Enrichment
Github GHSA