Fedora Account System
Red Hat Associate
Red Hat Customer
Disclaimer: Community trackers are created by Red Hat Product Security team on a best effort basis. Package maintainers are required to ascertain if the flaw indeed affects their package, before starting the update process. 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.
https://www.cve.org/CVERecord?id=CVE-2026-113718 https://github.com/pypa/virtualenv/security/advisories/GHSA-394h-qwmc-48pf I tried the reproduction steps in the GitHub advisory, replacing > subprocess.run(["virtualenv", "--quiet", "--no-periodic-update", "--prompt", hostile_prompt, env_dir], check=True) with > subprocess.run(["uv", "venv", "--quiet", "--no-periodic-update", "--prompt", hostile_prompt, env_dir], check=True) and got: > activate_this.py read as UTF-8: os.environ["VIRTUAL_ENV_PROMPT"] = "中';__import__("os").system("touch /tmp/activate-this-gbk/MARKER")#" or os.path.basename(base) # noqa: SIM222 > Traceback (most recent call last): > File "/home/user/virtualenv/./repro", line 30, in <module> > print(f"activate_this.py read as GBK: {prompt_line.decode('gbk')}") > ~~~~~~~~~~~~~~~~~~^^^^^^^ > UnicodeDecodeError: 'gbk' codec can't decode byte 0xad in position 38: illegal multibyte sequence > decoding with 'gbk' codec failed If I comment out > print(f"activate_this.py read as GBK: {prompt_line.decode('gbk')}") then I get as far as > activate_this.py read as UTF-8: os.environ["VIRTUAL_ENV_PROMPT"] = "中';__import__("os").system("touch /tmp/activate-this-gbk/MARKER")#" or os.path.basename(base) # noqa: SIM222 > Traceback (most recent call last): > File "/tmp/repro.d/activate_with_exec_open.py", line 9, in <module> > exec(open(this_file).read(), {"__file__": this_file}) > ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > File "<string>", line 49 > os.environ["VIRTUAL_ENV_PROMPT"] = "中';__import__("os").system("touch /tmp/activate-this-gbk/MARKER")#" or os.path.basename(base) # noqa: SIM222 > ^^ > SyntaxError: invalid syntax. Is this intended to be part of the string? This suggests that either uv is not affected, or perhaps I have just botched my reproduction attempt.