Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
🐍
🐍 PyPI
Not in CISA KEV
HIGH severity

virtualenv bash and fish activation scripts execute commands embedded in pathsGHSA-p58f-9548-mpm2

HIGHFix: pypa/virtualenv#3252

GHSA-p58f-9548-mpm2 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.

Also known asBIT-virtualenv-2026-102925CVE-2026-102925PYSEC-2026-4013
Published
Updated
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed
Exploitation data as of Oct 23, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

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 GHSA-p58f-9548-mpm2.

EPSS Exploitation Probability

via FIRST.org ↗
0.2%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs4th percentile — riskier than 4% of all scored CVEsHighest risk
0.00%0.22%0.44%0.65%0.2%0.2%Oct 26Oct 26

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

How urgent is this, really

GHSA-p58f-9548-mpm2 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

1 pkg affected
🐍virtualenv

Real-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

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
🐍PyPIvirtualenvall versions21.7.13pip install --upgrade 'virtualenv==21.7.13'

Detection & mitigation playbook

Open-source dependency
  1. Detect

    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.

  2. Fix

    Update virtualenv to 21.7.13 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-p58f-9548-mpm2 is resolved across your whole dependency graph.

  3. 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.

Red HatImportant

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…

Workaround published by Red Hat
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 GHSA-p58f-9548-mpm2 (CC BY 4.0)
ProductFixed inAdvisory
Red Hat Ansible Automation Platform 2.6ansible-automation-platform-26/eda-controller-rhel9:1791945282RHSA-2026:87120
Red Hat Ansible Automation Platform 2.7ansible-automation-platform-27/eda-controller-rhel9:1792141010RHSA-2026:87124
Red Hat OpenShift AI 2.25rhoai/odh-feature-server-rhel9:1792148523RHSA-2026:87410
Red Hat OpenShift AI 3.4rhoai/odh-feature-server-rhel9:1791863220RHSA-2026:84734
Red Hat OpenShift AI 3.5rhoai/odh-ta-lmes-job-rhel9:1792501995RHSA-2026:86891

Frequently Asked Questions

### 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: ```sh echo "Virtual environment directory __VIRTUAL_ENV__ does not exist!" >&2 ``` For a destination named `x'$(id)'y`, `s
O3 Security · Impact-Aware SCA

Is GHSA-p58f-9548-mpm2 in your dependencies?

Find it across PyPI, including transitive dependencies.

GHSA-p58f-9548-mpm2: virtualenv — Fixed in 21.7.13