cve.bz

CVE-2026-102937 pypa virtualenv: OS Command Injection

7.3 highEPSS 0.2%Fix available

High (7.3) in pypa virtualenv. EPSS 0.2% estimated probability of exploitation activity in the next 30 days. Fixed in virtualenv 21.7.12.

On this page
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.

Severity

CVSS 4.0

7.3 high
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
EPSS
0.2% (unchanged from 0.2% a week ago; 0.1% 30 days ago) estimated probability of exploitation activity in the next 30 days; 11th percentile. Scored 2026-11-17. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: yes · Technical impact: total, assessed 2026-10-02. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-78 Improper Neutralization of Special Elements used in an OS Command (OS Command Injection)
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Under analysis
Record from
the NVD, synced

Fix and patched versions

  • virtualenv (PyPI): fixed in 21.7.12

Ask an AI about this CVE

Show the promptExplain CVE-2026-102937 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2026-102937?via=ask-ai-copy and https://cve.bz/cve/CVE-2026-102937?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2026-102937 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
pypa virtualenv< 21.7.12

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-x78j-v8h9-3j2qPyPIvirtualenv<21.7.1221.7.12
PYSEC-2026-4014PyPIvirtualenv<21.7.1221.7.12

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian12, 13, 14python-virtualenvno fix listedDEBIAN-CVE-2026-102937
Ubuntu14.04:LTS, 16.04:LTS, 18.04:LTS and 5 morepython-virtualenvno fix listedUBUNTU-CVE-2026-102937
Azure Linux3python-pipno fix listedAZL-105648
Azure Linux3python-virtualenvno fix listedAZL-105666

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Microsoft's Azure Linux vulnerability data, MIT. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu.

Red Hat

Red Hat rates this Important.

Red Hat's statement

An IMPORTANT severity command injection flaw was found in virtualenv, a tool for creating isolated Python virtual environments that is shipped as a bundled dependency in Red Hat offerings such as Red Hat OpenShift AI, Red Hat Enterprise Linux UBI container images, Red Hat Hardened Images components, and Fedora/EPEL community projects. On Windows, virtualenv's BatchActivator did not escape the prompt value before writing it into the cmd.exe set "VAR=value" statement of a generated activate.bat script. An attacker who can influence the prompt value, via the --prompt option, the VIRTUALENV_PROMPT environment variable, or the corresponding configuration setting, can supply a double quote that terminates the assignment and injects arbitrary cmd.exe commands. When a user activates the generated virtual environment on Windows, the injected commands run with that user's privileges, resulting in arbitrary code execution. The vulnerability is limited to the Windows batch activation script because the injected syntax is cmd.exe-specific. Exploitation requires the attacker to influence the prompt text and a user to activate the crafted environment, so scenarios that template the prompt from untrusted input, such as CI jobs deriving prompts from branch names, are most exposed. Some Red Hat components that bundle virtualenv are not affected because the vulnerable code or the component itself is not present in the shipped versions. For the affected Red Hat and community offerings the impact is rated IMPORTANT, and because virtualenv reaches these products as a dependency, fixes are being pursued through the delegated product and community maintainers rather than a direct Red Hat security update. Red Hat scores this flaw 7.8 (CVSS:3.1) while the upstream CVEORG record scores it 7.3 (CVSS:4.0); the difference reflects differing assessments of attack complexity and required user interaction, and both scores place the flaw in the high severity range.

ProductPackageStateAdvisory
Red Hat Ansible Automation Platform 2.6ansible-automation-platform-26/eda-controller-rhel9:1791945282Fixed 2026-10-21RHSA-2026:87120
Red Hat Ansible Automation Platform 2.7ansible-automation-platform-27/eda-controller-rhel9:1792141010Fixed 2026-10-21RHSA-2026:87124
Red Hat OpenShift AI 2.25rhoai/odh-feature-server-rhel9:1792148523Fixed 2026-10-21RHSA-2026:87410
Red Hat OpenShift AI 3.4rhoai/odh-feature-server-rhel9:1791863220Fixed 2026-10-19RHSA-2026:84734
Red Hat OpenShift AI 3.4rhoai/odh-kserve-agent-rhel9:1791468381Fixed 2026-10-19RHSA-2026:84734
Red Hat OpenShift AI 3.4rhoai/odh-kserve-controller-rhel9:1791468368Fixed 2026-10-19RHSA-2026:84734
Red Hat OpenShift AI 3.4rhoai/odh-kserve-router-rhel9:1791468401Fixed 2026-10-19RHSA-2026:84734
Red Hat OpenShift AI 3.4rhoai/odh-kserve-storage-initializer-rhel9:1790958549Fixed 2026-10-19RHSA-2026:84734
Red Hat OpenShift AI 3.4rhoai/odh-ta-lmes-job-rhel9:1791470318Fixed 2026-10-19RHSA-2026:84734
Red Hat OpenShift AI 3.4rhoai/odh-training-rocm64-torch28-py312-rhel9:1791556461Fixed 2026-10-19RHSA-2026:84734
OpenShift Lightspeedopenshift-lightspeed/lightspeed-service-api-rhel9Not affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-25/ansible-dev-tools-rhel8Affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-26/ansible-dev-tools-rhel9Affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-26/controller-rhel9Not affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-26/lightspeed-chatbot-rhel9Not affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-27/ansible-devspaces-rhel9Affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-27/ansible-dev-tools-rhel9Affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-27/controller-rhel9Not affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-tech-preview/ansible-devspaces-rhel9Affected
Red Hat Ansible Automation Platform 2python3.11-virtualenvNot affected
30 more in the JSON and on Red Hat's page.

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2026-102937.

Attack patterns (CAPEC)

  • CAPEC-6 Argument Injection Likelihood: High · Severity: High
  • CAPEC-15 Command Delimiters Likelihood: High · Severity: High
  • CAPEC-43 Exploiting Multiple Input Interpretation Layers Likelihood: Medium · Severity: High
  • CAPEC-88 OS Command Injection Likelihood: High · Severity: High
  • CAPEC-108 Command Line Execution through SQL Injection Likelihood: Low · Severity: Very High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON