CVE-2024-9287: A vulnerability has been found in the CPython `venv` module and CLI where path names provided...
7.8
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.11741%
CWE
Published
10/22/2024
Updated
4/26/2025
KEV Status
No
Technology
-
Technical Details
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability is a command injection in CPython's venv module due to improperly quoted path names in activation scripts. The analysis focused on identifying functions involved in processing user-supplied paths and generating these scripts.
venv.EnvBuilder.replace_variablesis identified as the core vulnerable function because it performed direct string substitutions of user input (like environment paths) into script templates without quoting.venv.EnvBuilder.install_scriptsis crucial as it callsreplace_variablesand writes the processed (and previously vulnerable) script content to disk.venv.EnvBuilder.createis the main API method inEnvBuilderthat accepts the user-provided, potentially malicious, environment path, starting the vulnerable workflow.venv.main(fromLib/venv/__main__.py) is the CLI entry point that parses the user's input (including the environment path) and passes it toEnvBuilder.create. These functions would appear in a runtime profile during the creation of a virtual environment, and their interaction led to the vulnerability when unquoted, malicious path names were used.