CVE-2026-102925: CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in pypa virtualenv
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.
AI Analysis
Technical Summary
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.
CVE-2026-102925: CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in pypa 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
Affected software
pypa
virtualenv
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
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.
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 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.