CVE-2026-102938
Medium 5.8No known exploitationFix availablevirtualenv writes prompt values into pyvenv.cfg without sanitizing line boundaries, allowing configuration injection
Record last updated
CVSS score
Medium on a 0 to 10 scale
EPSS, chance of exploitation in 30 days
Higher than 5% of scored CVEs. A prediction, not evidence.
CISA remediation deadline
Not in the KEV catalog
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.
Weakness: CWE-93
Patching and mitigation
- Patch status
- Fix available (source: NVD (reference tagged Patch))
- Fix documented (source date)
- Mitigation
- None documented
- Vendor guidance
- msrc.microsoft.com (opens in a new tab)
Affected products
| Vendor | Product | Affected versions | Fixed in | Per |
|---|---|---|---|---|
| Microsoft | azl3 python-virtualenv 20.36.1-6 on Azure Linux 3.0 | Not documented | 20.36.1-9 | Microsoft MSRC |
| Microsoft | azl4 python-virtualenv 20.35.4-6.azl4 on Azure Linux 4.0 | Not documented | Not documented | Microsoft MSRC |
| virtualenv | virtualenv | all versions before 21.7.11 | 21.7.11 | NIST NVD |
Timeline
Advisory
Microsoft advisory published
Advisory change
Microsoft advisory revised (2.0): Information published.
Advisory change
Microsoft advisory revised (3.0): Information published.
Advisory change
Microsoft advisory revised (4.0): Information published.
Advisory change
Microsoft advisory revised (5.0): Information published.
Patch
Fix documented by NVD (reference tagged Patch)
Vendor guidance and references
- https://github.com/pypa/virtualenv/commit/a30f995461043acb6cacbf3a890951563ccf7140 (opens in a new tab)patch
- https://github.com/pypa/virtualenv/pull/3247 (opens in a new tab)issue tracking, patch
- Microsoft Security Update Guide (opens in a new tab)vendor-advisory
- https://github.com/pypa/virtualenv/releases/tag/21.7.11 (opens in a new tab)release notes
- https://github.com/pypa/virtualenv/security/advisories/GHSA-9h9j-4vrj-gf7g (opens in a new tab)vendor advisory