CVE-2026-102925: pypa virtualenv command injection in activation scripts

CVE-2026-102925 · Severity: high · CVSS 7.8 · Published 2026-09-29

virtualenv is a Python tool that creates isolated development environments. The activation scripts (bash, zsh, and fish) generated by versions prior to 21.7.13 improperly escape special characters in virtual environment paths, allowing arbitrary shell commands to be executed when a user activates a crafted environment. An attacker who can create a malicious virtual environment path can gain code execution with the privileges of the user running the activation script.

Technologies: Pypa Virtualenv, virtualenv (PyPI). Vendors: Pypa, PyPI.

Quick answers

Is CVE-2026-102925 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-102925 being exploited in the wild.
How severe is CVE-2026-102925?
High severity, with a CVSS score of 7.8, published 29 September 2026.
Which products and versions are affected?
Pypa Virtualenv before 21.7.13; virtualenv (PyPI) <= 21.7.12, ECOSYSTEM:introduced=0,fixed=21.7.13.
Is there a fix for CVE-2026-102925?
Yes. virtualenv (PyPI): upgrade to 21.7.13 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-102925 attacked?
It is attacked with local access, in a software library.
Am I affected by CVE-2026-102925?
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.13 or later
    pip install "virtualenv>=21.7.13"

Technical details

The vulnerability stems from improper quoting in the generated activate scripts where values already escaped by shlex.quote() are placed inside additional quoted contexts. In bash and zsh, a crafted virtual environment path can be injected into the __VIRTUAL_ENV__ variable; in fish, Tcl/Tk library paths can be injected into __TCL_LIBRARY__ or __TK_LIBRARY__. The surplus quotes allow shell metacharacters to break out of the data context and be interpreted as commands during script sourcing. The fix removes the additional quoting layer to prevent command injection.

Affected products

  • pypa virtualenv before 21.7.13

Identifiers

  • CVE-2026-102925
  • GHSA-p58f-9548-mpm2
  • PYSEC-2026-4013

Timeline

  • 2026-09-29: disclosed
  • 2026-09-18: patched: Fix merged in commit 4d5a105

References

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