CVE-2024-9287: CPython venv CLI Command Injection via Unquoted Paths
CVE-2024-9287 Published on October 22, 2024

Virtual environment (venv) activation scripts don't quote paths
A vulnerability has been found in the CPython `venv` module and CLI where path names provided when creating a virtual environment were not quoted properly, allowing the creator to inject commands into virtual environment "activation" scripts (ie "source venv/bin/activate"). This means that attacker-controlled virtual environments are able to run commands when the virtual environment is activated. Virtual environments which are not created by an attacker or which aren't activated before being used (ie "./venv/bin/python") are not affected.

Vendor Advisory NVD

Weakness Type

Unquoted Search Path or Element

The product uses a search path that contains an unquoted element, in which the element contains whitespace or other separators. This can cause the product to access resources in a parent path. If a malicious individual has access to the file system, it is possible to elevate privileges by inserting such a file as "C:\Program.exe" to be run by a privileged program making use of WinExec.


Products Associated with CVE-2024-9287

You can be notified by email with stack.watch whenever vulnerabilities like CVE-2024-9287 are published in these products:

 
 
 
 

Affected Versions

Python Software Foundation CPython: cpython:

Exploit Probability

EPSS
0.06%
Percentile
19.77%

EPSS (Exploit Prediction Scoring System) scores estimate the probability that a vulnerability will be exploited in the wild within the next 30 days. The percentile shows you how this score compares to all other vulnerabilities.