Vulnerability · Published Sep 29, 2026 · Assigned by GitHub_M
CVE-2026-102938virtualenv writes prompt values into pyvenv.cfg without sanitizing line boundaries, allowing configuration injection
Medium 5.8
In plain English
A medium-severity security flaw in virtualenv from pypa. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.1% (higher than 4% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
virtualenv is a tool for creating isolated virtual python environments. Prior to 21.7.11, PyEnvCfg.write() writes prompt values verbatim to the line-oriented pyvenv.cfg format while PyEnvCfg._read_values() parses the file with str.splitlines() and accepts the last value for duplicate keys. An attacker who influences --prompt, VIRTUALENV_PROMPT, or configuration input can insert a recognized line boundary and additional keys, including home, causing consumers to use an attacker-selected base interpreter or corrupted environment metadata. The security impact requires prompt input from outside the operator's trust boundary; directly supplied prompt content primarily corrupts the operator's own environment. This issue is fixed in version 21.7.11.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | python-virtualenv | no fix listed | DEBIAN-CVE-2026-102938 |
| Debian:13 | python-virtualenv | no fix listed | DEBIAN-CVE-2026-102938 |
| Debian:14 | python-virtualenv | no fix listed | DEBIAN-CVE-2026-102938 |
| PyPI | virtualenv | 21.7.11 | PYSEC-2026-4012 |
| PyPI | virtualenv | 21.7.11 | GHSA-9h9j-4vrj-gf7g |
| Ubuntu:26.04:LTS | python-virtualenv | no fix listed | UBUNTU-CVE-2026-102938 |
| Ubuntu:26.10 | python-virtualenv | no fix listed | UBUNTU-CVE-2026-102938 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| pypa | virtualenv | < 21.7.11 |
Weakness: CWE-93 · Vector: CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:P/VC:L/VI:H/VA:L/SC:N/SI:N/SA:N
References
- https://github.com/pypa/virtualenv/security/advisories/GHSA-9h9j-4vrj-gf7g x_refsource_CONFIRM
- https://github.com/pypa/virtualenv/pull/3247 x_refsource_MISC
- https://github.com/pypa/virtualenv/commit/a30f995461043acb6cacbf3a890951563ccf7140 x_refsource_MISC
- https://github.com/pypa/virtualenv/releases/tag/21.7.11 x_refsource_MISC