IT SBIT Services
Schneeberger
DEEN
CVE tracker

virtualenv: Command injection via environment name in bash activate script

CVE-2026-113725High 7.8

← All vulnerabilities

Summary

virtualenv versions before 21.14.7 do not escape the environment name correctly for both passes that bash makes over the prompt variable PS1. A crafted name containing a backslash followed by $(...) or backticks is executed as commands each time bash draws the prompt. An attacker who gets a user to activate a crafted virtual environment, for example from an untrusted repository or shared folder, can run commands with that user's privileges for as long as the shell stays open.

Affected

  • virtualenv before 21.14.7 (PyPI package virtualenv, pypa/virtualenv)
  • Bash activation script only

Fixed in

  • 21.14.7 (fix in commit c3104e0)
  • 21.14.9 is the newer release and also addresses further activation-script advisories

Workaround

  • Set VIRTUAL_ENV_DISABLE_PROMPT=1 before sourcing the activate script (temporary measure)
  • Activate only environments you created yourself or whose names you have checked

Exploitation

  • No reports of in-the-wild exploitation found.
  • CISA SSVC assessment: exploitation none, automatable no, technical impact total.
  • EPSS 0.00193 (low).
  • The advisory contains a reproduction example; it is not reproduced here.

Our recommendation

  • Find all virtualenv installs and pins (requirements files, poetry.lock, uv.lock, CI images) and upgrade to 21.14.9 or later.
  • Tell developers not to activate untrusted virtual environments until the upgrade is done.
  • Apply the workaround on systems that cannot be patched immediately.
  • Prioritise developer workstations and CI/build runners.

Public exploits

PoC-in-GitHub, Metasploit and Exploit-DB list nothing for this CVE.

Research sources

Researched and written up in English and German by an AI (Claude by Anthropic) based on NVD, CISA, EPSS and the sources listed. The vendor information is authoritative. Researched on 1 Nov 2026, 23:32.

Original description (NVD)

virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.7, the bash activate script escapes the environment name for only one of the two passes bash makes over PS1, so a backslash in the name undoes the escaping and a name containing \$(...) runs as commands in the user's shell each time bash draws the prompt. This issue is fixed in version 21.14.7.

NVD references (3)

Sources

The tracker combines official, freely usable data sources – updated continuously:

This product uses data from the NVD API but is not endorsed or certified by the NVD. EPSS data © FIRST.org.

Affected? We can help.

We check whether your systems are affected, install updates and close the gap – continuously with the System Health Checker if you wish.