Command execution in virtualenv activate script under zsh
Key facts
- Attack vector
- Local
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Partial Red Hat: 5 without a fix
Attack profile from CVSS 3.1 · CNA. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-78.
Summary
virtualenv before 21.14.4 has an activate script that leaves the environment name unescaped for zsh. With PROMPT_SUBST enabled in zsh, command, parameter or arithmetic expansion syntax in an environment directory name, --prompt or VIRTUALENV_PROMPT value runs commands in the user's shell each time the prompt is drawn (CWE-78). An attacker who can influence those values can trigger this when a user activates the environment.
Written with Claude Haiku 5.5 from the sources below · 2026-11-07
Description from the CNA
virtualenv is a tool for creating isolated virtual python environments. Prior to 21.13.0, the bash activate script that zsh also sources leaves the environment name unescaped; from 21.13.0 until 21.14.4, it escapes backslashes, dollar signs, and backticks only when BASH_VERSION is set, so zsh receives the raw value. The script assigns that value to PS1. In zsh with PROMPT_SUBST, an attacker-influenced environment directory, --prompt, or VIRTUALENV_PROMPT value containing command, parameter, or arithmetic expansion syntax can therefore execute commands in the user's shell each time the prompt is drawn. A percent sign is separately interpreted as a zsh prompt escape but does not by itself execute commands. Plain zsh with PROMPT_SUBST disabled and bash are not affected by this mechanism. This issue is fixed in version 21.14.4.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| pypa | virtualenv | before 21.14.4 | 21.14.4 | Patch available | CNA |
| — | virtualenv (PyPI) | before 21.14.4 | 21.14.4 | Patch available | GHSA-5vjq-rrrf-7h2q |
- virtualenv Vendorpypa Affected before 21.14.4 Fixed in 21.14.4 Patch available CNA
- virtualenv (PyPI) Vendor— Affected before 21.14.4 Fixed in 21.14.4 Patch available GHSA-5vjq-rrrf-7h2q
Remediation
Upgrade virtualenv to 21.14.4, the fixed version listed for PyPI. Red Hat lists OpenShift Lightspeed as affected with no fix planned, and Red Hat Ansible Automation Platform 2, Red Hat OpenShift AI (RHOAI), Red Hat OpenShift Dev Spaces and Red Hat Satellite 6 as affected with no fix available.
Written with Claude Haiku 5.5 from the sources below · 2026-11-07
- Fix · CNA virtualenv (pypa) Fixed in 21.14.4
- Fix · GHSA-5vjq-rrrf-7h2q virtualenv (PyPI) Fixed in 21.14.4 Advisory →
Vendor assessments
Red Hat
Red Hat rating: Important. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| OpenShift Lightspeed | Affected | No fix planned: Will not fix |
| Red Hat Ansible Automation Platform 2 | Affected | No fix yet |
| Red Hat OpenShift AI (RHOAI) | Affected | No fix yet |
| Red Hat OpenShift Dev Spaces | Affected | No fix yet |
| Red Hat Satellite 6 | Affected | No fix yet |
Not affected: 3 products
- Red Hat Ansible Automation Platform 2
- Red Hat OpenShift AI (RHOAI)
- Red Hat OpenShift Container Platform 4
Timeline
- 2026-10-21 Threatist record created from CVE-2026-113726
- 2026-10-21 Affected versions changed · Red Hat
- 2026-10-21 CVSS score added · Red Hat
- 2026-10-21 Alias added: GHSA-5vjq-rrrf-7h2q
- 2026-10-21 Fix available: PyPI/[email protected] · GHSA-5vjq-rrrf-7h2q
- 2026-10-21 CVSS score added · GHSA-5vjq-rrrf-7h2q
- 2026-10-21 Weakness changed · GHSA-5vjq-rrrf-7h2q
- 2026-10-21 5 new references · GHSA-5vjq-rrrf-7h2q
- 2026-10-22 Priority changed: MEDIUM → LOW
- 2026-10-22 Affected versions changed · Red Hat
- 2026-10-27 CISA SSVC decision points changed
- 2026-11-02 Affected versions changed · Red Hat
- 2026-11-03 Affected versions changed · Red Hat
- 2026-11-07 Affected versions changed · Red Hat
References
More pypa vulnerabilities
- TI-2025-29803 setuptools has a path traversal vulnerability in PackageIndex.download that leads to Arbitrary File Write CVSS 4.0HIGH 7.7
- TI-2024-05888 Remote Code Execution in pypa/setuptools CVSS 3.0HIGH 8.8
- TI-2026-78525 Shell command injection in virtualenv generated POSIX launchers CVSS 3.1HIGH 7.8
- TI-2026-78526 Command injection in virtualenv bash activation prompt CVSS 4.0HIGH 7.1
- TI-2026-78521 Code injection in virtualenv Xonsh activation script CVSS 4.0HIGH 7.1
- TI-2026-19377 wheel Allows Arbitrary File Permission Modification via Path Traversal CVSS 3.1HIGH 7.1
Sources
- CVE-2026-113726 · CVE Program
- CVE-2026-113726 · NVD
- FIRST EPSS
- GHSA-5vjq-rrrf-7h2q · GitHub Advisory Database · CC BY 4.0
- CVE-2026-113726 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences