Skip to main content

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

0
High
VulnerabilityCVE-2026-113726cvecve-2026-113726cwe-78cwe-116
Published: 10/20/2026 (10/20/2026, 22:05:24 UTC)
Source: CVE Database V5
Vendor/Project: pypa
Product: virtualenv

Description

CVE-2026-113726 is an OS command injection vulnerability in pypa virtualenv affecting versions prior to 21.14.4. The issue arises from improper escaping of environment names in the bash activate script, which zsh also sources. Specifically, from versions 21.13.0 to before 21.14.4, the script escapes certain characters only when BASH_VERSION is set, leaving zsh vulnerable to command execution via specially crafted environment variables when PROMPT_SUBST is enabled. This vulnerability allows an attacker to execute arbitrary commands in the user's shell prompt. The flaw is fixed in version 21.14.4.

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
<21.14.4
virtualenv
pkg:pypi/virtualenv
Affected versions
<21.14.4

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:29 UTC

Technical Analysis

The vulnerability in pypa virtualenv involves improper neutralization of special elements used in OS commands (CWE-78). The bash activate script, which is also sourced by zsh, fails to properly escape environment names under certain conditions. From version 21.13.0 until 21.14.4, escaping occurs only if BASH_VERSION is set, so zsh receives unescaped input. When zsh's PROMPT_SUBST option is enabled, an attacker-controlled environment directory, --prompt, or VIRTUALENV_PROMPT containing command or parameter expansion syntax can cause arbitrary command execution each time the shell prompt is drawn. This does not affect plain zsh with PROMPT_SUBST disabled or bash shells. The vulnerability is resolved in virtualenv version 21.14.4.

Potential Impact

An attacker who can influence the environment directory, --prompt, or VIRTUALENV_PROMPT variables can execute arbitrary commands in the user's shell when using zsh with PROMPT_SUBST enabled. This can lead to full compromise of the user's shell environment, including confidentiality, integrity, and availability impacts as indicated by the CVSS score of 7.8 (high severity). Bash users and zsh users without PROMPT_SUBST enabled are not affected.

Mitigation Recommendations

This vulnerability is fixed in virtualenv version 21.14.4. Users should upgrade to version 21.14.4 or later to remediate this issue. No other mitigation is required if upgrading is possible. Users of zsh with PROMPT_SUBST disabled or bash are not affected by this vulnerability.

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-20T16:03:14.863Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 6ad7e8e52cdf04f656695f7a

Added to database: 10/20/2026, 22:19:17 UTC

Last enriched: 10/20/2026, 22:48:29 UTC

Last updated: 10/20/2026, 22:48:29 UTC

Views: 5

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