CVE-2026-102925
virtualenv bash and fish activation scripts execute commands embedded in paths
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.
Attack profile
How easy it is to exploit
- Attack vector
- Local
- Complexity
- Low
- Privileges needed
- None
- User interaction
- Required
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
CVE List Score used
7.8
virtualenv bash and fish activation scripts execute commands embedded in paths
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.
- Record
CVE-2026-102925- CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Weakness
- CWE-78
- Updated
- 2026-11-02
EUVDEUVD-2026-89461
7.8
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.
- Record
EUVD-2026-89461- CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-p58f-9548-mpm2
7.8
virtualenv bash and fish activation scripts execute commands embedded in paths
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.
- Record
GHSA-p58f-9548-mpm2- CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Weakness
- CWE-78
- Updated
- 2026-11-02
NVD
7.8
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.
- Record
CVE-2026-102925- CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Weakness
- CWE-78
- Updated
- 2026-11-02
OSV
7.8
virtualenv bash and fish activation scripts execute commands embedded in paths
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.
- Record
CVE-2026-102925- CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Weakness
- CWE-78
- Updated
- 2026-11-02
OSVDEBIAN-CVE-2026-102925
7.8
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.
- Record
DEBIAN-CVE-2026-102925- CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
Show 8 moreShow less
OSVGHSA-p58f-9548-mpm2
7.8
virtualenv bash and fish activation scripts execute commands embedded in paths
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.
- Record
GHSA-p58f-9548-mpm2- CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Weakness
- CWE-78
- Updated
- 2026-11-02
OSVPYSEC-2026-4013
7.8
virtualenv bash and fish activation scripts execute commands embedded in paths
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 (Virtual environment directory __VIRTUAL_ENV__ does not exist!). 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. 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__'). The rendered line becomes
''/tcl/(cmd)/lib'', and fish expands the (cmd) left between the adjacent
quoted runs. The same doubling 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.
Fixed in 21.7.13 by moving the placeholders outside the surrounding quotes, so
each value keeps only the quoting shlex.quote applied.
- Record
PYSEC-2026-4013- CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVUBUNTU-CVE-2026-102925
7.8
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.
- Record
UBUNTU-CVE-2026-102925- CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVAZL-105675 No score
CVE-2026-102925 affecting package python-virtualenv for versions less than 20.36.1-9
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.
- Record
AZL-105675- Updated
- 2026-11-05
OSVBIT-virtualenv-2026-102925 No score
virtualenv bash and fish activation scripts execute commands embedded in paths
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.
- Record
BIT-virtualenv-2026-102925- Updated
- 2026-11-02
OSVCLSA-2026-1791452380 No score
TuxCare security update for virtualenv (4 CVEs)
TuxCare rebuilt virtualenv to address 4 CVEs. Fixed in 20.39.1.post2+tuxcare.
- Record
CLSA-2026-1791452380- Updated
- 2026-11-02
OSVopenSUSE-SU-2026:11974-1 No score
python313-virtualenv-21.14.2-1.1 on GA media
These are all security issues fixed in the python313-virtualenv-21.14.2-1.1 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2026:11974-1- Updated
- 2026-11-02
OSVROOT-APP-PYPI-CVE-2026-102925 No score
CVE-2026-102925 in virtualenv - Patched by Root
Root has patched CVE-2026-102925 in the virtualenv package for Root:PyPI. Multiple fixed versions available.
- Record
ROOT-APP-PYPI-CVE-2026-102925- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
virtualenvPyPI |
through 21.7.12 | 21.7.13 |
python-virtualenvAzure Linux:3 |
before 20.36.1-9 | 20.36.1-9 |
virtualenvBitnami |
before 21.7.13 | 21.7.13 |
virtualenvTuxCare:PyPI From an advisory covering 4 CVEs |
20.39.1 up to 20.39.1.post2+tuxcare, plus listed versions 20.39.1.post1+tuxcare |
20.39.1.post2+tuxcare |
python-virtualenvDebian:13 |
All versions, plus listed versions 20.31.2+ds-120.31.2+ds-1+deb13u120.33.1+ds-120.34.0+ds-120.35.3+ds-1 Show 8 moreShow less20.35.4+ds-120.36.1+ds-120.38.0+ds-121.2.0+ds-121.2.4+ds-121.3.1+ds-121.4.1+ds-121.5.1+ds-1 |
None known |
python-virtualenvDebian:14 |
All versions, plus listed versions 20.31.2+ds-120.33.1+ds-120.34.0+ds-120.35.3+ds-120.35.4+ds-1 Show 7 moreShow less20.36.1+ds-120.38.0+ds-121.2.0+ds-121.2.4+ds-121.3.1+ds-121.4.1+ds-121.5.1+ds-1 |
None known |
virtualenvPyPI |
before 21.7.13, plus listed versions 0.80.8.10.8.20.8.30.8.4 Show 45 moreShow less0.90.9.10.9.21.01.11.101.10.11.111.11.11.11.21.11.31.11.41.11.51.11.61.21.31.3.11.3.21.3.31.3.41.41.4.11.4.21.4.31.4.41.4.51.4.61.4.71.4.81.4.91.4rc11.51.5.11.5.21.61.6.11.6.21.6.31.6.41.71.7.11.7.1.11.7.1.21.7.21.8 |
21.7.13 |
virtualenvRoot:PyPI |
before 21.4.3+aikido.1 | 21.4.3+aikido.121.3.2+aikido.121.2.4+aikido.121.4.2+aikido.120.34.0+aikido.320.34.0+aikido.420.35.4+aikido.320.35.4+aikido.420.34.0+aikido.520.36.1+aikido.320.36.1+aikido.420.36.1+aikido.521.6.1+aikido.221.5.1+aikido.121.5.1+aikido.221.7.8+aikido.221.7.1+aikido.121.7.1+aikido.221.7.9+aikido.221.2.4+aikido.221.7.5+aikido.121.7.5+aikido.221.7.5+aikido.321.7.7+aikido.221.7.10+aikido.321.7.4+aikido.321.7.4+aikido.420.26.6+aikido.420.26.6+aikido.521.3.2+aikido.221.3.2+aikido.321.7.1+aikido.321.4.3+aikido.221.7.5+aikido.421.2.4+aikido.321.7.9+aikido.321.7.4+aikido.521.7.10+aikido.421.7.8+aikido.321.7.10+aikido.521.7.4+aikido.621.6.1+aikido.321.4.2+aikido.221.7.5+aikido.521.7.1+aikido.421.7.9+aikido.421.4.3+aikido.321.2.4+aikido.421.3.2+aikido.420.39.1+aikido.320.31.2+aikido.3 |
python-virtualenvUbuntu:14.04:LTS |
All versions, plus listed versions 1.10.1-11.11-11.11-21.11.4-11.11.4-1ubuntu1 |
None known |
python-virtualenvUbuntu:16.04:LTS |
All versions, plus listed versions 1.11.6+ds-114.0.5+ds-114.0.5+ds-214.0.5+ds-415.0.0+ds-1 Show 6 moreShow less15.0.0+ds-215.0.1+ds-115.0.1+ds-215.0.1+ds-315.0.1+ds-3ubuntu115.0.1+ds-3ubuntu1.1 |
None known |
Show 7 moreShow less
| Package | Affected | Fixed |
|---|---|---|
python-virtualenvUbuntu:18.04:LTS |
All versions, plus listed versions 15.1.0+ds-115.1.0+ds-1.1 |
None known |
python-virtualenvUbuntu:Pro:20.04:LTS |
All versions, plus listed versions 15.1.0+ds-215.1.0+ds-2build115.1.0+ds-2ubuntu120.0.13-120.0.17-120.0.17-1ubuntu0.320.0.17-1ubuntu0.420.0.17-1ubuntu0.4+esm1 |
None known |
python-virtualenvUbuntu:Pro:22.04:LTS |
All versions, plus listed versions 20.4.6+ds-220.10.0+ds-120.12.1+ds-120.13.0+ds-120.13.0+ds-220.13.0+ds-2ubuntu0.1~esm1 |
None known |
python-virtualenvUbuntu:Pro:24.04:LTS |
All versions, plus listed versions 20.24.1+ds-120.24.6+ds-120.24.6+ds-220.25.0+ds-120.25.0+ds-220.25.0+ds-2ubuntu0.1~esm1 |
None known |
python-virtualenvUbuntu:26.10 |
All versions, plus listed versions 20.36.1+ds-121.4.1+ds-121.5.1+ds-1 |
None known |
python-virtualenvUbuntu:26.04:LTS |
All versions, plus listed versions 20.31.2+ds-120.35.3+ds-120.35.4+ds-120.36.1+ds-1 |
None known |
python-virtualenvopenSUSE:Tumbleweed From an advisory covering 4 CVEs |
before 21.14.2-1.1 | 21.14.2-1.1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected | ||
| facts | OSV | |
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-102925 is a high vulnerability (CVSS 7.8) in Pypa Virtualenv, published September 18, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.16%, the 5th percentile. Fixed in virtualenv 21.7.13.
References
github.com/pypa/virtualenv/security/advisories/GHSA-p58f-9548-mpm2
github.com/pypa/virtualenv/pull/3252
github.com/pypa/virtualenv/commit/4d5a105ec2a2723b8c7f4571bb68f4f71d01e3f6
github.com/pypa/virtualenv/releases/tag/21.7.13
nvd.nist.gov/vuln/detail/CVE-2026-102925
github.com/pypa/advisory-database/tree/main/vulns/virtualenv/PYSEC-2026-4013.yaml
Show 11 moreShow less
github.com/pypa/virtualenv
pypi.org/project/virtualenv
github.com/advisories/GHSA-p58f-9548-mpm2
github.com/CVEProject/cvelistV5/tree/main/cves/2026/102xxx/CVE-2026-102925.json
security-tracker.debian.org/tracker/CVE-2026-102925
ubuntu.com/security/CVE-2026-102925
cve.org/CVERecord?id=CVE-2026-102925
suse.com/security/cve/CVE-2024-9287
suse.com/security/cve/CVE-2026-102925
suse.com/security/cve/CVE-2026-102930
suse.com/security/cve/CVE-2026-102938
Left out here: 232 versions. The JSON record has them.