# CVE-2026-115586: virtualenv bash activate command injection via unescaped prompt

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

CVE-2026-115586 · Severity: high · CVSS 4 · Published 2026-10-23

virtualenv is a Python tool that creates isolated virtual environments. Versions 21.14.9 through 21.14.12 allow an attacker to inject shell commands through a crafted project name or custom prompt value, which execute when a user later enables certain bash options or starts a child shell. This could lead to arbitrary code execution with the privileges of the user activating the environment.

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-115586 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-115586 being exploited in the wild.

**How severe is CVE-2026-115586?** High severity, with a CVSS score of 4, published 23 October 2026.

**Which products and versions are affected?** Pypa Virtualenv 21.14.9 through 21.14.12; virtualenv (PyPI) >= 21.14.9, < 21.14.13, ECOSYSTEM:introduced=21.14.9,fixed=21.14.13.

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

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

**Am I affected by CVE-2026-115586?** 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.14.13 or later

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


## Technical details

The bash bin/activate script stores the prompt value in PS1 without escaping dollar signs or backticks when promptvars is disabled at activation time. If a user later enables promptvars, runs POSIX mode, or starts an interactive child bash that inherits the exported PS1, command substitution syntax like $(command) in the stored VIRTUAL_ENV_PROMPT expands and executes. The vulnerability affects versions 21.14.9 to 21.14.12 and is fixed by properly escaping the prompt value regardless of shell state at activation.

## Affected products

- pypa virtualenv 21.14.9 through 21.14.12

## Identifiers

- CVE-2026-115586
- GHSA-cx6f-vjhg-g3cc

## Timeline

- 2026-10-23: disclosed

## References

- [https://github.com/pypa/virtualenv/commit/3598e201f6f044e389136b2347a8a919ac03c5f4](https://github.com/pypa/virtualenv/commit/3598e201f6f044e389136b2347a8a919ac03c5f4)
- [https://github.com/pypa/virtualenv/pull/3466](https://github.com/pypa/virtualenv/pull/3466)

## Related threats

- [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)
- [virtualenv safe_delete symlink mode change vulnerability](https://junglewise.ai/threats/cve-2026-113724-virtualenv-is-a-tool-for-creating-isolated-virtual-python)
