CVE-2026-113776
7.8 HIGHpublic exploit availablePublished 2026-10-20 · Updated 2026-10-22
AI risk analysis
- Summary
- virtualenv versions 20.26.6 to 21.14.2 contain a template injection flaw where placeholder substitution occurs sequentially across the entire activation script, allowing an attacker-controlled value (e.g., in --prompt or destination path) containing placeholders like __VIRTUAL_NAME__ to be re-substituted during a later pass, potentially breaking out of quoting and executing arbitrary code when the environment is activated in bash, fish, xonsh, or via activate_this.py.
- Exploitability
- Exploitation requires the attacker to control either the virtual environment's destination path or the --prompt argument such that it includes one of the vulnerable placeholder names inside an already substituted and quoted string, and the user must manually activate the environment using a supported shell or Python script.
- Blast radius
- Successful exploitation grants the attacker code execution with the privileges of the user who activated the environment, potentially leading to full system compromise in shared or multi-user environments where users install or use attacker-influenced virtual environments.
- Detection
- No reliable host or network indicator is derivable from the published description; exploitation depends on user interaction and does not produce unique log entries, process artefacts, or network signals beyond normal shell activation behavior.
- Prioritized remediation
- Upgrade to virtualenv version 21.14.2 or later, where sequential placeholder substitution has been fixed to prevent re-substitution of already-quoted values.
Analysis generated locally by garnet-coder (no data left the box). AI-assisted — verify against primary sources before acting.
NVD description
virtualenv is a tool for creating isolated virtual python environments. From 20.26.6 until 21.14.2, ViaTemplateActivator.instantiate_template() replaces placeholders one key at a time across the complete activation template, so trigger names such as __VIRTUAL_NAME__, __VIRTUAL_ENV__, or __VIRTUAL_PROMPT__ inside an already substituted and quoted environment path or prompt can be replaced during a later pass. The later value's quoting can close the earlier literal and execute the remaining path when a user activates the environment through bash, fish, xonsh, or activate_this.py. The distinct csh prompt-display token __VIRTUAL_PROMPT_DISPLAY_TCSH__ can instead break the generated script without establishing command execution. The attacker must influence the destination path or --prompt, and a value without a relevant placeholder name does not trigger this mechanism. This issue is fixed in version 21.14.2.
CVSS vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Weaknesses
CWE-78, CWE-94
Public exploit & PoC references
References
Data: NVD (public domain). Analysis: local $0 model. Defensive use only.