Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. virtualenv
  4. ›
  5. CVE-2026-102925

CVE-2026-102925: virtualenv bash and fish activation scripts execute commands embedded in paths

October 1, 2026

The generated activate (bash/zsh) and activate.fish scripts interpolate a shlex.quote-ed value into a position that quotes it a second time. The extra quotes terminate the quoted run early and leave part of the value parsed as shell code, so a path containing shell metacharacters runs commands when a user sources the activation script.

activate is affected through the virtual environment’s own path, on the branch that reports a relocated environment:

echo "Virtual environment directory __VIRTUAL_ENV__ does not exist!" >&2

For a destination named x'$(id)'y, shlex.quote emits 'x'"'"'$(id)'"'"'y'. The inner " closes the enclosing double quote and $(id) is left unquoted. Backtick and ; payloads reach the same result. This branch runs whenever the recorded path is absent, which is the normal case for a virtual environment copied or distributed to another machine.

activate.fish is affected through the interpreter’s Tcl/Tk library paths:

set -gx TCL_LIBRARY '__TCL_LIBRARY__'

shlex.quote already returns '/tcl/(cmd)/lib', so the rendered line is ''/tcl/(cmd)/lib''. fish concatenates the adjacent quoted runs and expands the (cmd) left between them. The same doubling also splits a path containing a space into two list elements, corrupting TCL_LIBRARY and TK_LIBRARY.

This is the same defect class as GHSA-x78j-v8h9-3j2q, which covered activate.bat.

References

  • github.com/advisories/GHSA-p58f-9548-mpm2
  • github.com/pypa/advisory-database/tree/main/vulns/virtualenv/PYSEC-2026-4013.yaml
  • github.com/pypa/virtualenv
  • github.com/pypa/virtualenv/commit/4d5a105ec2a2723b8c7f4571bb68f4f71d01e3f6
  • github.com/pypa/virtualenv/pull/3252
  • github.com/pypa/virtualenv/releases/tag/21.7.13
  • github.com/pypa/virtualenv/security/advisories/GHSA-p58f-9548-mpm2
  • nvd.nist.gov/vuln/detail/CVE-2026-102925
  • pypi.org/project/virtualenv

Code Behaviors & Features

Detect and mitigate CVE-2026-102925 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions before 21.7.13

Fixed versions

  • 21.7.13

Solution

Upgrade to version 21.7.13 or above.

Impact 7.8 HIGH

CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')

Source file

pypi/virtualenv/CVE-2026-102925.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:16:03 +0000.