CVE-2026-102938
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
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
virtualenvPyPI | < 21.7.11 | 21.7.11 |
Affected products
5- osv-coords4 versionspkg:bitnami/virtualenvpkg:rpm/opensuse/python-virtualenv&distro=openSUSE%20Tumbleweedpkg:rpm/opensuse/python-virtualenv&distro=openSUSE%20Leap%2016.0pkg:rpm/opensuse/python-virtualenv&distro=openSUSE%20Leap%2016.1
< 21.7.11+ 3 more
- (no CPE)range: < 21.7.11
- (no CPE)range: < 21.14.2-1.1
- (no CPE)range: < 20.29.3-160000.4.1
- (no CPE)range: < 20.29.3-160100.3.1
- Range: >=21.7.11
Patches
Vulnerability mechanics
References
8- github.com/pypa/virtualenv/commit/a30f995461043acb6cacbf3a890951563ccf7140nvdPatchWEB
- github.com/pypa/virtualenv/pull/3247nvdIssue TrackingPatchWEB
- github.com/advisories/GHSA-9h9j-4vrj-gf7gghsaADVISORY
- github.com/pypa/virtualenv/security/advisories/GHSA-9h9j-4vrj-gf7gnvdVendor AdvisoryWEB
- nvd.nist.gov/vuln/detail/CVE-2026-102938ghsaADVISORY
- github.com/pypa/advisory-database/tree/main/vulns/virtualenv/PYSEC-2026-4012.yamlghsaWEB
- github.com/pypa/virtualenv/releases/tag/21.7.11nvdRelease NotesWEB
- pypi.org/project/virtualenvghsaWEB
News mentions
0No linked articles in our index yet.