CVE Database›CVE-2024-9287

CVE-2024-9287

python: Virtual environment (venv) activation scripts don't quote paths

Loading…

Severity

Moderate

Red Hat Product Security

6.3

CVSS 3.1

Review impact separately from score.

Published · October 23, 2024

Updated · August 18, 2026

Description

A vulnerability has been found in the Python venv module and CLI. Path names provided when creating a virtual environment were not quoted properly, allowing the creator to inject commands into virtual environment "activation" scripts, for example, "source venv/bin/activate". This flaw allows attacker-controlled virtual environments to run commands when the virtual environment is activated.

Statement

This vulnerability in the Python venv module is rated as moderate rather than important because it relies on a specific set of conditions to be exploitable, limiting its impact. An attacker would need to have control over the virtual environment creation process and access to the environment setup, which is less common in typical usage scenarios. Furthermore, the vulnerability only poses a risk if users activate the malicious virtual environment through source venv/bin/activate or similar scripts, as direct invocation of the virtual environment without activation (./venv/bin/python) is not affected.

Versions of python36:3.6/python36 and python39:3.9/python39 as shipped with Red Hat Enterprise Linux 8 are marked as 'Not affected' as they just provide "symlinks" to the main python3 component, which provides the actual interpreter of the Python programming language.

CVSS score applicability

The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.

Mitigation

Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.

CVSS / CWE

CVSS 3.1 · 6.3
CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:C/C:L/I:H/A:N

CWE-428 · Unquoted Search Path or Element