Skip to main content

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

0
High
VulnerabilityCVE-2026-102925cvecve-2026-102925cwe-78
Published: 09/29/2026 (09/29/2026, 20:50:57 UTC)
Source: CVE Database V5
Vendor/Project: pypa
Product: virtualenv

Description

virtualenv is a tool for creating isolated virtual python environments. Prior to 21.7.13, the generated activate (bash and zsh) and activate.fish scripts place values already escaped by shlex.quote inside an additional quoted context. In the bash and zsh script, a crafted virtual environment path reaches __VIRTUAL_ENV__ when a relocated environment's recorded directory is absent; in the fish script, crafted Tcl or Tk library paths reach __TCL_LIBRARY__ or __TK_LIBRARY__. The surplus quotes can terminate the data-only quoted run and leave shell metacharacters parsed as commands when a user sources the activation script, allowing code execution with that user's privileges. This issue is fixed in version 21.7.13.

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.7.13
virtualenv
pkg:pypi/virtualenv
Affected versions
<21.7.13

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: 09/29/2026, 21:21:15 UTC

Technical Analysis

The vulnerability in virtualenv occurs because the activate scripts for bash, zsh, and fish place values already escaped by shlex.quote inside an additional quoted context. In bash and zsh, a crafted virtual environment path can reach the __VIRTUAL_ENV__ variable when a relocated environment's recorded directory is missing. In fish scripts, crafted Tcl or Tk library paths can reach __TCL_LIBRARY__ or __TK_LIBRARY__. The surplus quotes terminate the intended quoted string, allowing shell metacharacters to be parsed as commands during script sourcing, leading to OS command injection. This flaw is resolved in virtualenv version 21.7.13.

Potential Impact

An attacker who can influence the virtual environment path or Tcl/Tk library paths can craft values that, when the activation script is sourced, execute arbitrary commands with the privileges of the user running the script. This can lead to full compromise of the user's environment. The CVSS 3.1 score is 7.8 (high), reflecting local attack vector, low complexity, no privileges required, user interaction required, and high impact on confidentiality, integrity, and availability.

Mitigation Recommendations

Upgrade virtualenv to version 21.7.13 or later, where this vulnerability is fixed. There is no indication of any alternative mitigations or temporary workarounds. Users should avoid sourcing activation scripts from untrusted virtual environments until patched.

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-09-29T20:24:43.339Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 6abc287d680226ef6848d2d6

Added to database: 09/29/2026, 21:07:09 UTC

Last enriched: 09/29/2026, 21:21:15 UTC

Last updated: 09/30/2026, 03:03:21 UTC

Views: 10

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