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.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| pypa | virtualenv | < 21.7.13 | — |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | python-virtualenv | No fix yet | — |
| Debian 13 | python-virtualenv | No fix yet | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 26.10 | python-virtualenv | No fix yet | — |
| Ubuntu 26.04 LTS | python-virtualenv | No fix yet | — |
| Ubuntu 18.04 LTS | python-virtualenv | No fix yet | — |
| Ubuntu 16.04 LTS | python-virtualenv | No fix yet | — |
| Ubuntu 14.04 LTS | python-virtualenv | No fix yet | — |
Show 1 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Pro 20.04 LTS | python-virtualenv | No fix yet | — |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | python-virtualenv | 21.14.2-1.1 | openSUSE-SU-2026:11974-1 |
Azure Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Azure Linux 3 | python-virtualenv | 20.36.1-9 | — |
Wolfi
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Wolfi rolling | py3-cassandra-medusa | 0.30.1-r3 | — |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| PyPI | virtualenv | < 21.7.13 | 21.7.13 | GHSA-p58f-9548-mpm2 |
Advisories 2
- WID-SEC-2026-4111 Red Hat Ansible Automation Platform: Mehrere Schwachstellen BSI CERT-Bund (WID) · Nov 12, 2026
- openSUSE-SU-2026:11974-1 python313-virtualenv-21.14.2-1.1 on GA media SUSE / openSUSE Security Updates · Oct 3, 2026