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

CVE-2026-113726: virtualenv activate runs commands from the environment name in zsh with PROMPT_SUBST

October 21, 2026

zsh users activate an environment with the bash activate script, which puts the environment name into PS1. Since 21.13.0 the script escapes backslashes, dollar signs and backticks in that name, but only when BASH_VERSION is set, so zsh gets the raw value. With the PROMPT_SUBST option set, zsh runs parameter expansion, command substitution and arithmetic expansion on PS1 each time it draws the prompt. A name that contains $(...), backticks or ${...} then runs as commands in the user’s shell, once per prompt.

The name comes from the environment directory, or from --prompt or VIRTUALENV_PROMPT. After you create an environment with:

$ virtualenv 'x$(touch PWNED)y'

source 'x$(touch PWNED)y/bin/activate' in a zsh session with PROMPT_SUBST set creates PWNED, and the prompt shows (xy). Passing that value as --prompt to an environment with a plain name has the same effect. Without PROMPT_SUBST, zsh shows the name as text and runs nothing. bash runs nothing either.

References

  • github.com/advisories/GHSA-5vjq-rrrf-7h2q
  • github.com/pypa/virtualenv/commit/5b915367da82bd024b2a0d28d2f98007034b4aa2
  • github.com/pypa/virtualenv/releases/tag/21.14.4
  • github.com/pypa/virtualenv/security/advisories/GHSA-5vjq-rrrf-7h2q
  • nvd.nist.gov/vuln/detail/CVE-2026-113726

Code Behaviors & Features

Detect and mitigate CVE-2026-113726 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.14.4

Fixed versions

  • 21.14.4

Solution

Upgrade to version 21.14.4 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-116: Improper Encoding or Escaping of Output
  • CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')

Source file

pypi/virtualenv/CVE-2026-113726.yml

Spotted a mistake? Edit the file on GitLab.

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

Page generated Sun, 08 Nov 2026 00:15:30 +0000.