virtualenv: Command injection via --prompt in activate.bat (batch activator)
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.
- Products
- virtualenv
- Affected versions
- Not specified
- Fixed versions
- 21.7.12
- CVEs
- CVE-2026-102937
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 27 Oct 2026, 11:22 UTC · Revision 1
Source evidence
virtualenv: Command injection via --prompt in activate.bat (batch activator)
core-osv · Original sourcePublished 6 Oct 2026, 11:57 UTC
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.
osv:BIT-virtualenv-2026-102937
virtualenv
Fixed versions: 21.7.12
Complete source record
{
"id": "86fad34a71d353660829408fe6c6bccb496419d58825805fc10f76ea4fd6407c",
"url": "https://osv.dev/vulnerability/BIT-virtualenv-2026-102937",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "virtualenv: Command injection via --prompt in activate.bat (batch activator)",
"summary": "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.",
"evidence": "osv:BIT-virtualenv-2026-102937",
"products": [
{
"name": {
"value": "virtualenv",
"evidence": "/affected/0/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "21.7.12",
"evidence": "/affected/0/ranges"
}
],
"affected_versions": []
}
],
"severity": "high",
"structured": {
"id": "BIT-virtualenv-2026-102937",
"aliases": [
"BIT-virtualenv-2026-102937",
"CVE-2026-102937",
"GHSA-x78j-v8h9-3j2q",
"PYSEC-2026-4014"
],
"affected": [
{
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "0"
},
{
"fixed": "21.7.12"
}
]
}
],
"package": {
"name": "virtualenv",
"purl": "pkg:bitnami/virtualenv",
"ecosystem": "Bitnami"
},
"severity": [
{
"type": "CVSS_V4",
"score": "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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X"
}
],
"database_specific": {
"source": "https://github.com/bitnami/vulndb/tree/main/data/virtualenv/BIT-virtualenv-2026-102937.json"
}
}
],
"modified": "2026-10-06T15:26:00.196757436Z",
"provider": "osv",
"references": [
"https://github.com/pypa/virtualenv/commit/d721ff140ce4afdc2a9b76751e4584e25d9fbea6",
"https://github.com/pypa/virtualenv/pull/3250",
"https://github.com/pypa/virtualenv/releases/tag/21.7.12",
"https://github.com/pypa/virtualenv/security/advisories/GHSA-x78j-v8h9-3j2q",
"https://nvd.nist.gov/vuln/detail/CVE-2026-102937"
],
"provider_metadata": {
"cpes": [
"cpe:2.3:a:virtualenv:virtualenv:*:*:*:*:*:python:*:*"
],
"severity": "High"
}
},
"related_cves": [
{
"value": "CVE-2026-102937",
"evidence": "/aliases"
}
],
"security_relevant": true,
"severity_evidence": "/database_specific/severity"
},
"source_id": "core-osv",
"document_id": 89146,
"published_at": "2026-10-06T11:57:38.51+00:00"
}