# CVE-2026-102937: virtualenv command injection in activate.bat via prompt parameter

Source: https://junglewise.ai/threats/cve-2026-102937-virtualenv-is-a-tool-for-creating-isolated-virtual-python  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-09-29. Updated: 2026-09-29  
License: CC BY 4.0 with a link back

CVE-2026-102937 · Severity: high · CVSS 4 · Published 2026-09-29

virtualenv is a tool that creates isolated Python environments on Windows and other systems. Prior to version 21.7.12, the activate.bat batch file failed to properly escape the --prompt parameter, allowing an attacker to inject arbitrary cmd.exe commands that execute with the user's privileges when the virtual environment is activated. An attacker who controls the prompt value (via command-line, environment variable, or configuration file) can achieve code execution on machines using affected virtualenv versions.

Technologies: [Pypa Virtualenv](https://junglewise.ai/threats/technologies/pypa-virtualenv), [virtualenv (PyPI)](https://junglewise.ai/threats/technologies/virtualenv). Vendors: [Pypa](https://junglewise.ai/threats/vendors/pypa), [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2026-102937 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-102937 being exploited in the wild.

**How severe is CVE-2026-102937?** High severity, with a CVSS score of 4, published 29 September 2026.

**Which products and versions are affected?** Pypa Virtualenv before 21.7.12; virtualenv (PyPI) <= 21.7.11, ECOSYSTEM:introduced=0,fixed=21.7.12.

**Is there a fix for CVE-2026-102937?** Yes. virtualenv (PyPI): upgrade to 21.7.12 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-102937 attacked?** It is attacked with local access, in a software library.

**Am I affected by CVE-2026-102937?** Check whether you run Pypa Virtualenv or virtualenv (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- virtualenv (PyPI): upgrade to 21.7.12 or later

  ```sh
  pip install "virtualenv>=21.7.12"
  ```


## Technical details

The vulnerability exists in BatchActivator.quote() which fails to escape double quotes in the prompt text before inserting it into a cmd.exe set "VAR=value" statement in activate.bat. An attacker can include a closing double quote followed by cmd.exe operators to break out of the assignment and execute arbitrary commands. The attack requires local or network access to influence the --prompt, VIRTUALENV_PROMPT environment variable, or configuration file, and triggers when a user activates the virtual environment. The issue is fixed in version 21.7.12 by properly escaping batch special characters.

## Affected products

- pypa virtualenv before 21.7.12

## Identifiers

- CVE-2026-102937
- GHSA-x78j-v8h9-3j2q
- PYSEC-2026-4014

## Timeline

- 2026-09-29: disclosed
- 2026-09-18: patched

## References

- [https://github.com/pypa/virtualenv/commit/d721ff140ce4afdc2a9b76751e4584e25d9fbea6](https://github.com/pypa/virtualenv/commit/d721ff140ce4afdc2a9b76751e4584e25d9fbea6)
- [https://github.com/pypa/virtualenv/pull/3250](https://github.com/pypa/virtualenv/pull/3250)

## Related threats

- [virtualenv bash activate command injection via unescaped prompt](https://junglewise.ai/threats/cve-2026-115586-virtualenv-is-a-tool-for-creating-isolated-virtual-python)
- [virtualenv command injection in activation script template substitution](https://junglewise.ai/threats/cve-2026-113776-virtualenv-is-a-tool-for-creating-isolated-virtual-python)
- [virtualenv command injection in Fish shell activation script](https://junglewise.ai/threats/cve-2026-113732-virtualenv-is-a-tool-for-creating-isolated-virtual-python)
- [pypa virtualenv command injection in bash activate script](https://junglewise.ai/threats/cve-2026-113726-virtualenv-is-a-tool-for-creating-isolated-virtual-python)
- [virtualenv bash activate script command injection in PS1](https://junglewise.ai/threats/cve-2026-113725-virtualenv-is-a-tool-for-creating-isolated-virtual-python)
