{"id":"CVE-2026-102937","published":"2026-09-29T20:56:13Z","modified":"2026-10-02T12:28:15Z","title":"virtualenv: Command injection via --prompt in activate.bat (batch activator)","vendor":"pypa","product":"virtualenv","tier":"tail","description":{"text":"virtualenv is a tool for creating isolated virtual python environments. Prior to 21.7.12, BatchActivator.quote() returns prompt text unchanged before activate.bat inserts it into a cmd.exe set \"VAR=value\" statement. An attacker who influences --prompt, VIRTUALENV_PROMPT, or the corresponding configuration value can include a double quote that closes the assignment and leaves following cmd.exe operators as executable syntax. When a user activates the generated Windows environment, the injected commands run with that user's privileges. This issue is fixed in version 21.7.12.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.3,"severity":"HIGH","version":"4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00225,"percentile":0.0782,"provenance":"source"},"cwes":[{"id":"CWE-78","name":"Improper Neutralization of Special Elements used in an OS Command"}],"references":[{"url":"https://github.com/pypa/virtualenv/security/advisories/GHSA-x78j-v8h9-3j2q","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/pypa/virtualenv/pull/3250","tags":["x_refsource_MISC"]},{"url":"https://github.com/pypa/virtualenv/commit/d721ff140ce4afdc2a9b76751e4584e25d9fbea6","tags":["x_refsource_MISC"]},{"url":"https://github.com/pypa/virtualenv/releases/tag/21.7.12","tags":["x_refsource_MISC"]}],"priority":{"score":6.7,"factors":[{"name":"EPSS percentile","points":1.56},{"name":"CVSS severity","points":5.11}]},"vendorSlug":"pypa","affectedVersions":[{"vendor":"pypa","product":"virtualenv","versions":["< 21.7.12"]}],"ssvc":{"exploitation":"none","automatable":"yes","technicalImpact":"total","timestamp":"2026-10-02T12:28:00.914294Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"virtualenv","vulnerableRanges":["<21.7.12"],"patched":["21.7.12"],"from":["GHSA-x78j-v8h9-3j2q","PYSEC-2026-4014"],"provenance":"source"}],"summary":{"text":"The virtualenv tool for creating isolated Python environments contains a command injection flaw in its Windows batch activator (activate.bat), where the prompt text supplied via --prompt, the VIRTUALENV_PROMPT variable, or the matching configuration setting is not escaped before being written into a cmd.exe assignment. An attacker who controls that prompt value and can get a user to activate the generated Windows environment can break out of the assignment with a double quote and have injected commands run with that user's privileges.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:17:23Z"},"euvd":{"id":"EUVD-2026-89464","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-pypa-virtualenv-cve-2026-102925","parents":[{"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"]}]}],"children":[{"from":"CVE-2026-102937","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/d721ff140ce4afdc2a9b76751e4584e25d9fbea6","https://github.com/pypa/virtualenv/commit/d25f28699eefb1fc34a251e5adf2b5de844c36cd"],"basis":"shared function","functions":["write"]}]}],"packageHistory":[{"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},{"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},{"cve":"CVE-2026-113732","published":"2026-10-20","fixed":"21.14.2","kev":false},{"cve":"CVE-2026-113776","published":"2026-10-20","fixed":"21.14.2","kev":false}],"package":"PyPI:virtualenv"}}