CVE-2026-102937: CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in pypa virtualenv
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.
AI Analysis
Technical Summary
The vulnerability in pypa virtualenv (before 21.7.12) involves improper neutralization of special elements in OS commands (CWE-78). Specifically, BatchActivator.quote() does not sanitize prompt text before it is inserted into a cmd.exe set "VAR=value" statement in activate.bat. An attacker controlling the --prompt, VIRTUALENV_PROMPT, or equivalent configuration can inject a double quote to prematurely close the assignment and append arbitrary cmd.exe commands. These commands execute with the privileges of the user activating the environment. The issue is resolved in version 21.7.12.
Potential Impact
An attacker able to influence the prompt value can execute arbitrary commands on the Windows system with the privileges of the user activating the virtual environment. This can lead to unauthorized command execution and potential compromise of the user's environment.
Mitigation Recommendations
Upgrade virtualenv to version 21.7.12 or later, where this vulnerability is fixed. No other mitigation is required as the fix addresses the root cause.
CVE-2026-102937: CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in pypa virtualenv
Description
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.
CVSS v4.0
Score 7.3high
Affected software
pypa
virtualenv
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in pypa virtualenv (before 21.7.12) involves improper neutralization of special elements in OS commands (CWE-78). Specifically, BatchActivator.quote() does not sanitize prompt text before it is inserted into a cmd.exe set "VAR=value" statement in activate.bat. An attacker controlling the --prompt, VIRTUALENV_PROMPT, or equivalent configuration can inject a double quote to prematurely close the assignment and append arbitrary cmd.exe commands. These commands execute with the privileges of the user activating the environment. The issue is resolved in version 21.7.12.
Potential Impact
An attacker able to influence the prompt value can execute arbitrary commands on the Windows system with the privileges of the user activating the virtual environment. This can lead to unauthorized command execution and potential compromise of the user's environment.
Mitigation Recommendations
Upgrade virtualenv to version 21.7.12 or later, where this vulnerability is fixed. No other mitigation is required as the fix addresses the root cause.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-09-29T20:24:43.340Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 6abc287d680226ef6848d2d3
Added to database: 09/29/2026, 21:07:09 UTC
Last enriched: 09/29/2026, 21:21:22 UTC
Last updated: 09/30/2026, 03:03:21 UTC
Views: 10
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.