High severity · published Oct 22, 2024
CVE-2024-9287
Virtual environment (venv) activation scripts don't quote paths
7.8
CVSS
0.6%
EPSS
No
On KEV
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 (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.
CVSS vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Attack vector
Local
Complexity
Low
Privileges
Low
User interaction
None
Confidentiality
High
Integrity
High
Availability
High
Scope
Unchanged
Exploitation
Is it being used?
Exploit prediction (EPSS)0.6% · higher than 51% of CVEs
Exploited in the wildNo evidence yet
CISA KEVNot listed
Ransomware campaign useNot known
Affected products
Which versions
CP
CPython · Python Software Foundation
before 3.9.21; 3.10.0 before 3.10.16; 3.11.0 before 3.11.11; 3.12.0 before 3.12.8; 3.13.0 before 3.13.1; 3.14.0a1 before 3.14.0a2 · source: vendor, CISA
PY
Python · Python
before 3.9.21; 3.10.0 before 3.10.16; 3.11.0 before 3.11.11; 3.12.0 before 3.12.8; 3.13.0 before 3.13.1; 3.14.0 · source: NVD
References
NVD
https://nvd.nist.gov/vuln/detail/CVE-2024-9287
CVE.org
https://www.cve.org/CVERecord?id=CVE-2024-9287
Patch
https://github.com/python/cpython/commit/633555735a023d3e4d92ba31da35b1205f9ecbd7
Patch
https://github.com/python/cpython/commit/8450b2482586857d689b6658f08de9c8179af7db
Patch
https://github.com/python/cpython/commit/9286ab3a107ea41bd3f3c3682ce2512692bdded8
Patch
https://github.com/python/cpython/commit/ae961ae94bf19c8f8c7fbea3d1c25cc55ce8ae97
Patch
https://github.com/python/cpython/commit/d48cc82ed25e26b02eb97c6263d95dcaa1e9111b
Patch
https://github.com/python/cpython/commit/e52095a0c1005a87eed2276af7a1f2f66e2b6483
More from CPython
9.4
CVE-2026-115557
Distrust compromised intermediate certificates in ssl module
9.4
CVE-2025-4517
Arbitrary writes via tarfile realpath overflow
9.2
CVE-2026-19445
Use-after-free of a server-side SSLContext when sni_callback switches contexts
8.8
CVE-2026-3298
Out-of-bounds write in Windows asyncio.ProacterEventLoop.sock_recvfrom_into() when using nbytes
8.7
CVE-2024-8088
Infinite loop when iterating over zip archive entry names from zipfile.Path
