Command Injection Affecting virtualenv package, versions [,21.7.12)


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.14% (3rd 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-20335500
  • published30 Sept 2026
  • disclosed29 Sept 2026
  • creditBernát Gábor

Introduced: 29 Sep 2026

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

How to fix?

Upgrade virtualenv to version 21.7.12 or higher.

Overview

Affected versions of this package are vulnerable to Command Injection via the BatchActivator.quote method in src/virtualenv/activation/batch/__init__.py, which previously returned its input string unchanged. When a virtualenv is created in a path containing cmd.exe operator characters such as &, |, <, >, ^, !, or ", those characters are embedded verbatim into the generated activate.bat script inside @set "VAR=value" statements. An attacker who controls the virtualenv path or environment values can inject arbitrary cmd.exe commands that execute when a user sources the activation script.

CVSS Base Scores

version 4.0
version 3.1