Skip to main content

CVE-2026-102937: CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in pypa virtualenv

0
High
VulnerabilityCVE-2026-102937cvecve-2026-102937cwe-78
Published: 09/29/2026 (09/29/2026, 20:56:13 UTC)
Source: CVE Database V5
Vendor/Project: pypa
Product: 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

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
Passive
Vuln. Confidentiality
High
Vuln. Integrity
High
Vuln. Availability
High
Subsq. Confidentiality
None
Subsq. Integrity
None
Subsq. Availability
None
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

Affected software

pypa

virtualenv

Affected versions
<21.7.12
virtualenv
pkg:pypi/virtualenv
Affected versions
<21.7.12

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 09/29/2026, 21:21:22 UTC

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses