Skip to main content

CVE-2026-113776: CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in pypa virtualenv

0
High
VulnerabilityCVE-2026-113776cvecve-2026-113776cwe-78cwe-94
Published: 10/20/2026 (10/20/2026, 22:03:18 UTC)
Source: CVE Database V5
Vendor/Project: pypa
Product: 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

Attack Vector
Local
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Affected software

pypa

virtualenv

Affected versions
>=20.26.6 <21.14.2
virtualenv
pkg:pypi/virtualenv
Affected versions
>=20.26.6 <21.14.2

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

AILast updated: 10/20/2026, 22:48:22 UTC

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses