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

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, virtualenv (PyPI). Vendors: Pypa, 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
    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

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.