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.

Severity (CVSS 4.0)5.8Medium
Exploit odds (30 days)0.1%top 96.1% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

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

EcosystemPackageFixed inAdvisory
Debian:12python-virtualenvno fix listedDEBIAN-CVE-2026-102938
Debian:13python-virtualenvno fix listedDEBIAN-CVE-2026-102938
Debian:14python-virtualenvno fix listedDEBIAN-CVE-2026-102938
PyPIvirtualenv21.7.11PYSEC-2026-4012
PyPIvirtualenv21.7.11GHSA-9h9j-4vrj-gf7g
Ubuntu:26.04:LTSpython-virtualenvno fix listedUBUNTU-CVE-2026-102938
Ubuntu:26.10python-virtualenvno fix listedUBUNTU-CVE-2026-102938

Affected products (as reported)

VendorProductVersions
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