GitHub advisory · PyPI
virtualenv: Venv configuration readback can reinterpret path boundaries
Description
The venv creator reads the standard library's generated pyvenv.cfg with splitlines() and merges all resulting keys over virtualenv's configuration. Line-boundary characters from destination data can therefore become configuration structure before output sanitization.
Anthropic's OSS Scanner reported this as ANT-2026-6ZQHJ6VI in virtualenv-20261015-005, received on 15 October 2026.
Configuration readback by the stdlib venv creator.
An untrusted caller must influence the destination pathname passed to the venv creator. That pathname must contain a character that Python treats as a line boundary. The builtin creator follows a different configuration-writing path.
The relevant 21.14.8 source is in venv readback, configuration parser.
With --creator venv, virtualenv asks the standard library to create an environment, reads its pyvenv.cfg with
str.splitlines(), and merges the parsed keys over virtualenv's chosen settings. CPython writes the destination into a
command = value without escaping every character that splitlines() recognizes as a line boundary. A destination
containing U+2028, for example, can therefore supply new home and include-system-site-packages keys during readback.
Virtualenv writes those keys as real configuration lines. The builtin creator does not use this readback path.
The scanner used one destination value with U+2028 between home = /attacker/chosen,
include-system-site-packages = true, and an absorbing x = key. A python -m venv --without-pip control kept the
value inside its command line and reported the base interpreter's sys._home. `virtualenv…
Manual fix · PyPI
pip install --upgrade "virtualenv>=21.14.9"Sources