CVE-2026-102925 is a high-severity (CVSS 7.8) OS Command Injection vulnerability in virtualenv. A fix is available for virtualenv — see the affected versions and patch details below.
virtualenv bash and fish activation scripts execute commands embedded in paths
Exploitation Status
No confirmed exploitation observed yet
- A successful exploit gives an attacker total control of the affected component, not partial access.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2026-102925.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
CVE-2026-102925 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.
Where this sits among everything scored
Of 394,803 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
virtualenvReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
Description
Impact
The generated activate (bash/zsh) and activate.fish scripts interpolate a shlex.quote-ed value into a position that quotes it a second time. The extra quotes terminate the quoted run early and leave part of the value parsed as shell code, so a path containing shell metacharacters runs commands when a user sources the activation script.
activate is affected through the virtual environment's own path, on the branch that reports a relocated environment:
echo "Virtual environment directory __VIRTUAL_ENV__ does not exist!" >&2
For a destination named x'$(id)'y, shlex.quote emits 'x'"'"'$(id)'"'"'y'. The inner " closes the enclosing double quote and $(id) is left unquoted. Backtick and ; payloads reach the same result. This branch runs whenever the recorded path is absent, which is the normal case for a virtual environment copied or distributed to another machine.
activate.fish is affected through the interpreter's Tcl/Tk library paths:
set -gx TCL_LIBRARY '__TCL_LIBRARY__'
shlex.quote already returns '/tcl/(cmd)/lib', so the rendered line is ''/tcl/(cmd)/lib''. fish concatenates the adjacent quoted runs and expands the (cmd) left between them. The same doubling also splits a path containing a space into two list elements, corrupting TCL_LIBRARY and TK_LIBRARY.
This is the same defect class as GHSA-x78j-v8h9-3j2q, which covered activate.bat.
Patches
Fixed in 21.7.13 by moving the placeholders outside the surrounding quotes, so each value keeps only the quoting shlex.quote applied. Fix: https://github.com/pypa/virtualenv/pull/3252
Workarounds
Avoid creating or distributing virtual environments whose path contains ', `, $, ;, ( or ), and inspect the generated activation script before sourcing one you did not create.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | virtualenv | all versions | 21.7.13pip install --upgrade 'virtualenv==21.7.13' |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for virtualenv, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update virtualenv to 21.7.13 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-102925 is resolved across your whole dependency graph.
Workarounds
Stop passing untrusted input into the interpreter or shell: call the affected binary with an argument array rather than a composed command string, reject anything outside a strict allowlist of expected values, and run the component under an account that cannot reach beyond the work it legitimately does.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
An Important severity flaw was found in virtualenv, a tool for creating isolated Python virtual environments that is bundled as a dependency in a number of Red Hat products, including Red Hat OpenShift AI, Red Hat Enterprise Linux container images, Red Hat Hardened Images, and other Red Hat-delivered components. The…
Avoid creating, copying, or distributing virtual environments whose path contains characters such as ', `, $, ;, (, or ), and inspect the generated activation script before sourcing one that you did not create; these precautions prevent shell metacharacters embedded in a crafted path from being executed when an activation script is sourced. The upstream project has released a fixed version of virtualenv, so updating to a version that includes the fix (21.7.13 or later, or a product update containing it) also addresses the issue.Source: Red Hat security advisory for CVE-2026-102925 (CC BY 4.0)
| Product | Fixed in | Advisory |
|---|---|---|
| Red Hat Ansible Automation Platform 2.6 | ansible-automation-platform-26/eda-controller-rhel9:1791945282 | RHSA-2026:87120 |
| Red Hat Ansible Automation Platform 2.7 | ansible-automation-platform-27/eda-controller-rhel9:1792141010 | RHSA-2026:87124 |
| Red Hat OpenShift AI 2.25 | rhoai/odh-feature-server-rhel9:1792148523 | RHSA-2026:87410 |
| Red Hat OpenShift AI 3.4 | rhoai/odh-feature-server-rhel9:1791863220 | RHSA-2026:84734 |
| Red Hat OpenShift AI 3.5 | rhoai/odh-ta-lmes-job-rhel9:1792501995 | RHSA-2026:86891 |
Frequently Asked Questions
Is CVE-2026-102925 in your dependencies?
Find it across PyPI, including transitive dependencies.