# CVE-2026-102938: virtualenv writes prompt values into pyvenv.cfg without sanitizing line boundaries, allowing configuration injection

- Priority: **Routine**
- Reason: Not severe (CVSS 5.8, local access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2026-09-29 · Modified: 2026-09-30
- Aliases: GHSA-9h9j-4vrj-gf7g, BIT-virtualenv-2026-102938, PYSEC-2026-4012, UBUNTU-CVE-2026-102938, DEBIAN-CVE-2026-102938, CGA-2475-q2cf-6xp8, CGA-mh7r-w3v8-42xh, CGA-q7jf-5v7v-8r55, CGA-xv2w-g4vq-wmcc, CGA-7q34-xxc3-fgj3, CGA-prjp-c89g-f2g9
- Record: https://cvemate.com/vulnerability/CVE-2026-102938 · JSON: https://cvemate.com/vulnerability/CVE-2026-102938/json

## Description

```text
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.
```

## Signals

- CVSS: 6.2 medium (v3.1, NVD) CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
- EPSS: 0.153%, percentile 4.64%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected

- chainguard mlflow-iamguarded-compat (Chainguard): \< 3.16.1-r1
- chainguard py3-cassandra-medusa (Chainguard): \< 0.30.1-r3
- chainguard request-1276 (Chainguard): \< 0.30.1-r3
- wolfi mlflow-iamguarded-compat (Wolfi): \< 3.16.1-r1
- wolfi py3-cassandra-medusa (Wolfi): \< 0.30.1-r3
- debian python-virtualenv (Debian): All versions (No fix recorded) \| \< 21.15.6+ds-1
- ubuntu python-virtualenv (Ubuntu): All versions (No fix recorded)
- pypa virtualenv: \< 21.7.11
- PyPI virtualenv (PyPI): \< 21.7.11
- virtualenv virtualenv: \< 21.7.11

## References

- <https://github.com/pypa/virtualenv/security/advisories/GHSA-9h9j-4vrj-gf7g>
- <https://github.com/pypa/virtualenv/pull/3247>
- <https://github.com/pypa/virtualenv/commit/a30f995461043acb6cacbf3a890951563ccf7140>
- <https://github.com/pypa/virtualenv/releases/tag/21.7.11>
- <https://nvd.nist.gov/vuln/detail/CVE-2026-102938>
- <https://github.com/pypa/advisory-database/tree/main/vulns/virtualenv/PYSEC-2026-4012.yaml>
- <https://github.com/pypa/virtualenv>
- <https://pypi.org/project/virtualenv>
- <https://ubuntu.com/security/CVE-2026-102938>
- <https://www.cve.org/CVERecord?id=CVE-2026-102938>
- <https://security-tracker.debian.org/tracker/CVE-2026-102938>
- <https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/102xxx/CVE-2026-102938.json>

---

Data as of 2026-12-05T06:42:45.709Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
