# CVE-2026-113726: pypa virtualenv command injection in bash activate script

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

CVE-2026-113726 · Severity: high · CVSS 7.8 · Published 2026-10-20

virtualenv is a Python tool that creates isolated development environments. When used with zsh shell and PROMPT_SUBST enabled, an attacker can embed shell command syntax in a virtual environment's name or prompt configuration, causing arbitrary commands to execute whenever the shell prompt is drawn. This could allow code execution when a user activates a malicious virtual 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-113726 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-113726 being exploited in the wild.

**How severe is CVE-2026-113726?** High severity, with a CVSS score of 7.8, published 20 October 2026.

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

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

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

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

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


## Technical details

The bash activate script sourced by zsh fails to properly escape shell metacharacters (command substitution syntax like $(...) and backticks) in the environment name before assigning it to the PS1 prompt variable. With zsh's PROMPT_SUBST option enabled, PS1 is re-evaluated at each prompt draw, causing embedded expansions to execute. The vulnerability affects versions prior to 21.14.4; versions 21.13.0–21.14.3 only escaped under bash (when BASH_VERSION is set), leaving zsh vulnerable. Plain bash and zsh without PROMPT_SUBST are not affected.

## Affected products

- pypa virtualenv before 21.14.4

## Identifiers

- CVE-2026-113726
- GHSA-5vjq-rrrf-7h2q

## Timeline

- 2026-10-20: disclosed

## References

- [https://github.com/pypa/virtualenv/commit/5b915367da82bd024b2a0d28d2f98007034b4aa2](https://github.com/pypa/virtualenv/commit/5b915367da82bd024b2a0d28d2f98007034b4aa2)
- [https://github.com/pypa/virtualenv/releases/tag/21.14.4](https://github.com/pypa/virtualenv/releases/tag/21.14.4)

## 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)
- [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)
