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

- Severity: Medium 5.8 (CVSS:4.0, scored by GitHub_M) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.15%, higher than 4% of CVEs (2026-12-01)
- Published: 2026-09-17T16:42:47.000Z
- Modified: 2026-11-27T06:45:48.141Z
- Also known as: GHSA-9h9j-4vrj-gf7g, BIT-VIRTUALENV-2026-102938, PYSEC-2026-4012
- Weaknesses: CWE-93
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- pypa virtualenv: < 21.7.11
- virtualenv (PyPI): before 21.7.11
- virtualenv virtualenv: before 21.7.11
- virtualenv (Bitnami): before 21.7.11

## Every score

- GitHub_M: CVSS:4.0 5.8 Medium `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`
- GitHub: CVSS:4.0 Medium `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`
- NVD: CVSS:3.1 6.2 Medium `CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N`
- Bitnami Vulnerability Database: rating Medium

## References

- <https://github.com/pypa/virtualenv/security/advisories/GHSA-9h9j-4vrj-gf7g> (advisory, vendor-advisory, web)
- <https://github.com/pypa/virtualenv/pull/3247> (fix, issue-tracking, patch, web)
- <https://github.com/pypa/virtualenv/commit/a30f995461043acb6cacbf3a890951563ccf7140> (fix, patch, web)
- <https://github.com/pypa/virtualenv/releases/tag/21.7.11> (article, release-notes, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-102938> (advisory, web)
- <https://github.com/pypa/advisory-database/tree/main/vulns/virtualenv/PYSEC-2026-4012.yaml> (web)
- <https://github.com/pypa/virtualenv> (package)
- <https://pypi.org/project/virtualenv> (package, web)

## Sources

- CVE List: [CVE-2026-102938](https://www.cve.org/CVERecord?id=CVE-2026-102938), CVE Terms of Use, modified 2026-09-30
- GitHub Advisory Database: [GHSA-9h9j-4vrj-gf7g](https://github.com/advisories/GHSA-9h9j-4vrj-gf7g), CC-BY-4.0, modified 2026-10-06
- NVD: [CVE-2026-102938](https://nvd.nist.gov/vuln/detail/CVE-2026-102938), Public domain, modified 2026-11-19
- PyPA Advisory Database: [PYSEC-2026-4012](https://osv.dev/vulnerability/PYSEC-2026-4012), CC-BY-4.0, modified 2026-10-06
- Bitnami Vulnerability Database: [BIT-VIRTUALENV-2026-102938](https://osv.dev/vulnerability/BIT-VIRTUALENV-2026-102938), Apache-2.0, modified 2026-11-27

---

Page: https://cve.day/CVE-2026-102938 · Whole record: https://cve.day/CVE-2026-102938.json · Rebuilt by cve.day 2026-11-27T07:07:23.918Z
