Command Injection Affecting virtualenv package, versions [,20.26.6)


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.06% (29th 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-8136228
  • published1 Oct 2024
  • disclosed1 Oct 2024
  • credity5c4l3

Introduced: 1 Oct 2024

CVE-2024-53899  (opens in a new tab)
CWE-78  (opens in a new tab)

How to fix?

Upgrade virtualenv to version 20.26.6 or higher.

Overview

Affected versions of this package are vulnerable to Command Injection due to improperly quoted string placeholders in activation scripts through the ViaTemplateActivator class. The vulnerable functions include various shell activation scripts where placeholders like __VIRTUAL_ENV__ are used.

Note:

  1. This vulnerability is specific to environments where shell scripts are used for virtual environment activation.

  2. Exploiting this vulnerability depends on the ability of the attacker to control the input to these placeholders, therefore it's unlikely to be exploited.

PoC

envname="';uname -a;':"
mkdir "$envname"
cd "$envname"
virtualenv .
. ./bin/activate

CVSS Scores

version 4.0
version 3.1