{"id":"CVE-2026-102938","published":"2026-09-29T20:58:20Z","modified":"2026-09-30T19:53:20Z","title":"virtualenv writes prompt values into pyvenv.cfg without sanitizing line boundaries, allowing configuration injection","vendor":"pypa","product":"virtualenv","tier":"tail","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.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.8,"severity":"MEDIUM","version":"4.0","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","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00212,"percentile":0.06517,"provenance":"source"},"cwes":[{"id":"CWE-93","name":"Improper Neutralization of CRLF Sequences"}],"references":[{"url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-9h9j-4vrj-gf7g","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/pypa/virtualenv/pull/3247","tags":["x_refsource_MISC"]},{"url":"https://github.com/pypa/virtualenv/commit/a30f995461043acb6cacbf3a890951563ccf7140","tags":["x_refsource_MISC"]},{"url":"https://github.com/pypa/virtualenv/releases/tag/21.7.11","tags":["x_refsource_MISC"]}],"priority":{"score":5.4,"factors":[{"name":"EPSS percentile","points":1.3},{"name":"CVSS severity","points":4.06}]},"vendorSlug":"pypa","affectedVersions":[{"vendor":"pypa","product":"virtualenv","versions":["< 21.7.11"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2026-09-30T19:53:10.688613Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"virtualenv","vulnerableRanges":["<21.7.11"],"patched":["21.7.11"],"from":["GHSA-9h9j-4vrj-gf7g","PYSEC-2026-4012"],"provenance":"source"}],"euvd":{"id":"EUVD-2026-89465","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-pypa-virtualenv-cve-2026-102925","children":[{"from":"CVE-2026-102938","to":"CVE-2026-102937","relation":"successor","confidence":"high","kind":"lineage","orderedBy":"description","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:virtualenv","fromFixed":"21.7.11","toFixed":"21.7.12","daysApart":0},{"kind":"same-code","provenance":"machine","files":["src/virtualenv/create/pyenv_cfg.py"],"commits":["https://github.com/pypa/virtualenv/commit/d721ff140ce4afdc2a9b76751e4584e25d9fbea6","https://github.com/pypa/virtualenv/commit/a30f995461043acb6cacbf3a890951563ccf7140"],"basis":"shared function","functions":["__repr__","write"]}]},{"from":"CVE-2026-102938","to":"CVE-2026-113721","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/virtualenv/create/pyenv_cfg.py"],"commits":["https://github.com/pypa/virtualenv/commit/a30f995461043acb6cacbf3a890951563ccf7140","https://github.com/pypa/virtualenv/commit/d25f28699eefb1fc34a251e5adf2b5de844c36cd"],"basis":"shared function","functions":["write"]}]},{"from":"CVE-2026-102938","to":"CVE-2026-115586","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["tox.toml"],"commits":["https://github.com/pypa/virtualenv/commit/a30f995461043acb6cacbf3a890951563ccf7140","https://github.com/pypa/virtualenv/commit/3598e201f6f044e389136b2347a8a919ac03c5f4"],"basis":"rarely changed file"}]}],"packageHistory":[{"cve":"CVE-2011-4617","published":"2011-12-31","fixed":"1.5","kev":false},{"cve":"CVE-2024-53899","published":"2024-11-24","fixed":"20.26.6","kev":false},{"cve":"CVE-2026-22702","published":"2026-01-10","fixed":"20.36.1","kev":false},{"cve":"CVE-2026-102938","published":"2026-09-29","fixed":"21.7.11","kev":false},{"cve":"CVE-2026-102930","published":"2026-09-29","fixed":"21.7.12","kev":false,"link":{"from":"CVE-2026-102938","to":"CVE-2026-102930","relation":"successor","confidence":"low","kind":"sequence","orderedBy":"description","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:virtualenv","fromFixed":"21.7.11","toFixed":"21.7.12","daysApart":0}]}},{"cve":"CVE-2026-102937","published":"2026-09-29","fixed":"21.7.12","kev":false},{"cve":"CVE-2026-102925","published":"2026-09-29","fixed":"21.7.13","kev":false}],"package":"PyPI:virtualenv"}}