CVE-2026-115586: virtualenv: Bash activator leaves the --prompt value unescaped in PS1 when promptvars is off, so prompt expansion later executes it (regression in 21.14.9)
The bash activator puts the caller-supplied prompt value into PS1 unescaped whenever promptvars is off at activation time, and assumes prompt expansion can never run afterwards. promptvars and posix mode are runtime shell state, not a property of the activation moment: re-enabling prompt expansion in the same shell (shopt -s promptvars, set -o posix) or starting an interactive child bash that inherits the exported PS1 makes bash expand the stored value and run the command substitution in it. An attacker who controls the prompt value gets command execution as the user who sources bin/activate.
This is a regression. 21.14.8 escaped $ and the backtick unconditionally and stays inert under the same sequence. The 21.14.9 fix for GHSA-6w3r-xr62-4xcp (#3418) rewrote that block and left bash with a path that stores the raw value whenever promptvars is off.
References
- github.com/advisories/GHSA-cx6f-vjhg-g3cc
- github.com/pypa/virtualenv/commit/3598e201f6f044e389136b2347a8a919ac03c5f4
- github.com/pypa/virtualenv/pull/3466
- github.com/pypa/virtualenv/releases/tag/21.14.13
- github.com/pypa/virtualenv/security/advisories/GHSA-cx6f-vjhg-g3cc
- nvd.nist.gov/vuln/detail/CVE-2026-115586
Code Behaviors & Features
Detect and mitigate CVE-2026-115586 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 →