virtualenv: Command injection via --prompt in activate.bat (batch activator)
Key facts
- Attack vector
- Local
- Privileges required
- None
- User interaction
- Passive
- Attack complexity
- Low
- Attack requirements
- Present
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Partial Red Hat: 5 fixed, 5 without a fix
Attack profile from CVSS 4.0 · CNA. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-78.
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- Yes
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| pypa | virtualenv | before 21.7.12 | 21.7.12 | Patch available | CNA |
| — | virtualenv (PyPI) | before 21.7.12 | 21.7.12 | Patch available | GHSA-x78j-v8h9-3j2q |
- virtualenv Vendorpypa Affected before 21.7.12 Fixed in 21.7.12 Patch available CNA
- virtualenv (PyPI) Vendor— Affected before 21.7.12 Fixed in 21.7.12 Patch available GHSA-x78j-v8h9-3j2q
Remediation
- Fix · CNA virtualenv (pypa) Fixed in 21.7.12
- Fix · GHSA-x78j-v8h9-3j2q virtualenv (PyPI) Fixed in 21.7.12 Advisory →
Red Hat 5 advisories
- RHSA-2026:87410 Released 2026-10-21 · Red Hat rating CriticalRHOAI 2.25.12 - Red Hat OpenShift AI
- Red Hat OpenShift AI 2.25 registry.redhat.io/rhoai/odh-built-in-detector-rhel9, registry.redhat.io/rhoai/odh-caikit-nlp-rhel9, registry.redhat.io/rhoai/odh-codeflare-operator-rhel9 +47
- RHSA-2026:87124 Released 2026-10-21 · Red Hat rating CriticalRed Hat Ansible Automation Platform 2.7 Container Release Update
- Red Hat Ansible Automation Platform 2.7 registry.redhat.io/ansible-automation-platform-27/de-supported-rhel9, registry.redhat.io/ansible-automation-platform-27/eda-controller-rhel9, registry.redhat.io/ansible-automation-platform-27/ee-supported-rhel9 +8
- RHSA-2026:87120 Released 2026-10-21 · Red Hat rating CriticalRed Hat Ansible Automation Platform 2.6 Container Release Update
- Red Hat Ansible Automation Platform 2.6 registry.redhat.io/ansible-automation-platform-26/eda-controller-rhel9, registry.redhat.io/ansible-automation-platform-26/ee-supported-rhel9, registry.redhat.io/ansible-automation-platform-26/gateway-rhel9 +8
Show 2 more Red Hat advisories
- RHSA-2026:86891 Released 2026-10-21 · Red Hat rating CriticalRHOAI 3.5.2 - Red Hat OpenShift AI
- Red Hat OpenShift AI 3.5 registry.redhat.io/rhoai/odh-automl-rhel9, registry.redhat.io/rhoai/odh-built-in-detector-rhel9, registry.redhat.io/rhoai/odh-cli-rhel9 +47
- RHSA-2026:84734 Released 2026-10-19 · Red Hat rating CriticalRHOAI 3.4.5 - Red Hat OpenShift AI
- Red Hat OpenShift AI 3.4 registry.redhat.io/rhoai/odh-ai-gateway-payload-processing-rhel9, registry.redhat.io/rhoai/odh-automl-rhel9, registry.redhat.io/rhoai/odh-autorag-rhel9 +47
Vendor assessments
Red Hat
Red Hat rating: Important. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Ansible Automation Platform 2 | Affected | No fix yet |
| Red Hat Enterprise Linux 8 | Affected | No fix yet |
| Red Hat OpenShift AI (RHOAI) | Affected | No fix yet |
| Red Hat Satellite 6 | Affected | No fix yet |
| Self-service automation portal 2 | Affected | No fix yet |
| Red Hat Ansible Automation Platform 2.6 | Fixed | RHSA-2026:87120 |
| Red Hat Ansible Automation Platform 2.7 | Fixed | RHSA-2026:87124 |
| Red Hat OpenShift AI 2.25 | Fixed | RHSA-2026:87410 |
| Red Hat OpenShift AI 3.4 | Fixed | RHSA-2026:84734 |
| Red Hat OpenShift AI 3.5 | Fixed | RHSA-2026:86891 |
Not affected: 10 products
- OpenShift Lightspeed
- Red Hat Ansible Automation Platform 2
- Red Hat Ansible Automation Platform 2.6
- Red Hat Ansible Automation Platform 2.7
- Red Hat Hardened Images
- Red Hat OpenShift AI 2.25
- Red Hat OpenShift AI 3.4
- Red Hat OpenShift AI 3.5
- Red Hat OpenShift Container Platform 4
- Red Hat OpenShift Dev Spaces
Timeline
- 2026-10-02 Threatist record created from CVE-2026-102937
- 2026-10-03 Alias added: GHSA-x78j-v8h9-3j2q
- 2026-10-06 Affected versions changed · Red Hat
- 2026-10-07 Affected versions changed · Red Hat
- 2026-10-16 Affected versions changed · Red Hat
- 2026-10-20 Fix available: RHSA-2026:84734 · Red Hat
- 2026-10-20 Fix available: Red Hat OpenShift AI 3.4 · Red Hat
- 2026-10-21 Affected versions changed · Red Hat
- 2026-10-22 Fix available: RHSA-2026:87124 · Red Hat
- 2026-10-22 Fix available: RHSA-2026:87120 · Red Hat
- 2026-10-22 Fix available: RHSA-2026:86891 · Red Hat
- 2026-10-22 Fix available: RHSA-2026:87410 · Red Hat
- 2026-10-23 Fix available: Red Hat Ansible Automation Platform 2.6, Red Hat Ansible Automation Platform 2.7, Red Hat OpenShift AI 2.25 +1 · Red Hat
References
Other 7
- https://github.com/pypa/virtualenv/security/advisories/GHSA-x78j-v8h9-3j2q
- https://github.com/pypa/virtualenv/pull/3250
- https://github.com/pypa/virtualenv/commit/d721ff140ce4afdc2a9b76751e4584e25d9fbea6
- https://github.com/pypa/virtualenv/releases/tag/21.7.12
- https://github.com/pypa/advisory-database/tree/main/vulns/virtualenv/PYSEC-2026-4014.yaml
- https://github.com/pypa/virtualenv
- https://pypi.org/project/virtualenv
More pypa vulnerabilities
- TI-2025-29803 setuptools has a path traversal vulnerability in PackageIndex.download that leads to Arbitrary File Write CVSS 4.0HIGH 7.7
- TI-2024-05888 Remote Code Execution in pypa/setuptools CVSS 3.0HIGH 8.8
- TI-2026-78525 Shell command injection in virtualenv generated POSIX launchers CVSS 3.1HIGH 7.8
- TI-2026-78526 Command injection in virtualenv bash activation prompt CVSS 4.0HIGH 7.1
- TI-2026-78521 Code injection in virtualenv Xonsh activation script CVSS 4.0HIGH 7.1
- TI-2026-19377 wheel Allows Arbitrary File Permission Modification via Path Traversal CVSS 3.1HIGH 7.1
Sources
- CVE-2026-102937 · CVE Program
- CVE-2026-102937 · NVD
- FIRST EPSS
- GHSA-x78j-v8h9-3j2q · GitHub Advisory Database · CC BY 4.0
- CVE-2026-102937 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences