CVE-2026-113776: CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in pypa virtualenv
Description
CVE-2026-113776 is an OS command injection vulnerability in pypa virtualenv affecting versions from 20.26.6 up to but not including 21.14.2. The issue arises from the way ViaTemplateActivator.instantiate_template() replaces placeholders in activation templates, allowing crafted inputs in environment paths or prompts to break quoting and execute arbitrary commands when activating the environment. This vulnerability requires user interaction and the attacker must control the destination path or --prompt value. It is fixed in version 21.14.2.
CVSS v3.1
Score 7.8high
Affected software
pypa
virtualenv
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in pypa virtualenv versions >=20.26.6 and <21.14.2 involves improper neutralization of special elements used in OS commands (CWE-78). The ViaTemplateActivator.instantiate_template() method replaces placeholders one key at a time in activation templates. If an attacker can influence the destination path or the --prompt argument with specially crafted values containing placeholders such as __VIRTUAL_NAME__, __VIRTUAL_ENV__, or __VIRTUAL_PROMPT__, the quoting of these values can be prematurely closed during substitution. This allows execution of arbitrary OS commands when the environment is activated via bash, fish, xonsh, or activate_this.py scripts. The csh shell prompt token __VIRTUAL_PROMPT_DISPLAY_TCSH__ can break the script but does not lead to command execution. The vulnerability is resolved in version 21.14.2.
Potential Impact
Successful exploitation can lead to arbitrary code execution with the privileges of the user activating the virtual environment. The vulnerability affects confidentiality, integrity, and availability (all rated high). Exploitation requires user interaction and control over environment path or prompt values. No known exploits in the wild have been reported.
Mitigation Recommendations
Upgrade virtualenv to version 21.14.2 or later, where this vulnerability is fixed. Until then, avoid using untrusted input in the destination path or --prompt parameters when creating or activating virtual environments. No other vendor mitigations or temporary fixes are documented.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-10-20T17:39:41.371Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 6ad7e8e52cdf04f656695f7c
Added to database: 10/20/2026, 22:19:17 UTC
Last enriched: 10/20/2026, 22:48:22 UTC
Last updated: 10/20/2026, 22:48:22 UTC
Views: 6
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.