Command Injection Affecting virtualenv package, versions [,21.14.7)


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.19% (9th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Command Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PYTHON-VIRTUALENV-21282509
  • published21 Oct 2026
  • disclosed20 Oct 2026
  • creditUnknown

Introduced: 20 Oct 2026

NewCVE-2026-113725  (opens in a new tab)
CWE-78  (opens in a new tab)

How to fix?

Upgrade virtualenv to version 21.14.7 or higher.

Overview

Affected versions of this package are vulnerable to Command Injection via insufficient escaping of the virtual environment name in the bash activate script (src/virtualenv/activation/bash/activate.sh). Bash processes PS1 in two passes each time it draws the prompt: it first decodes backslash prompt escapes (e.g. \\ becomes \, \$ becomes $), then expands the result. The activate script escapes the environment name for the expansion pass only, so a backslash in the name undoes that escaping. An attacker who controls the virtual environment name - through the directory name, the --prompt flag, or the VIRTUALENV_PROMPT environment variable - can supply a name such as a\$(touch PWNED), causing arbitrary shell commands to execute each time bash draws the prompt after the environment is activated.

CVSS Base Scores

version 4.0
version 3.1