PT-2024-39544 · Python+9 · Cpython+9
Seth Larson
·
Published
2024-10-22
·
Updated
2026-05-18
·
CVE-2024-9287
CVSS v3.1
7.8
High
| Vector | AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
Name of the Vulnerable Software and Affected Versions
CPython versions prior to 3.13.0
Description
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, such as 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, for example, ./venv/bin/python, are not affected.Recommendations
For CPython versions prior to 3.13.0, update Python CPython to a patched version as soon as possible to mitigate the risk of local attacks. As a temporary workaround, consider avoiding the activation of virtual environments that may have been created by an attacker, and instead use the virtual environment's Python executable directly, for example,
./venv/bin/python.Fix
Command Injection
Found an issue in the description? Have something to add? Feel free to write us 👾
Related Identifiers
Affected Products
Almalinux
Astra Linux
Cpython
Centos
Linuxmint
Red Hat
Red Os
Rocky Linux
Suse
Ubuntu