Cyber Resilience

CVE-2024-9287

Command Injection in Python ≤ 3.9.21

Published
22 October 2024
Modified
03 November 2025
Patch / advisory
CVSS Score v4 5.3
Click a component to see what it means
Raw vectorCVSS:4.0/AV:L/AC:L/AT:P/PR:H/UI:A/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:Green
EPSS Score 0.0065 47th percentile
Risk Priority 35 floored blend · peak EPSS

Summary

CVE-2024-9287 is a medium-severity Unquoted Search Path or Element (CWE-428) vulnerability in Python Python. Its CVSS base score is 5.3 (Medium).

Operationally, ranked at the 47th percentile by exploit likelihood (below the median); it is not currently listed in the CISA KEV catalog.

OWASP Top 10 for Web (2025)

EU & UK References

Vulnerability Data

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…

more

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.

CWE(s)

Related Threats

CVEs Like This One

CVE-2025-13462Same product: Python Python
CVE-2023-33595Same product: Python Python
CVE-2026-4224Same product: Python Python
CVE-2026-3644Same product: Python Python
CVE-2025-6075Same product: Python Python
CVE-2026-4519Same product: Python Python
CVE-2025-13837Same product: Python Python
CVE-2026-6019Same product: Python Python
CVE-2026-4360Same product: Python Python
CVE-2026-7210Same product: Python Python

Affected Assets

python
python
3.14.0 · ≤ 3.9.21 · 3.10.0 — 3.10.16 · 3.11.0 — 3.11.11

Mitigating Controls

Control response

Prevent
Stop it (NIST 800-53)

Detect
Catch it (NIST detect / respond)

Harden
Shrink the surface (DISA STIG)

Validate
Prove the fix (OWASP ASVS)
  • V1.2.3
  • V1.2.5
  • V1.2.8
  • V1.2.9

Mitigating Controls (NIST CSF 2.0) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→CSF cross-walk (authority under review) — links open the control.

PR.PS-06 mostly match
prevents

Secure SDLC practices directly prevent path-handling flaws such as unquoted elements during development.

DE.CM-09 partial match
prevents

Runtime monitoring of software and data can detect anomalous command execution resulting from injection.

ID.RA-01 partial match
prevents

Identifying recorded vulnerabilities enables remediation of command-injection flaws before exploitation.

Mitigating Controls (ISO/IEC 27001:2022 Annex A) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→ISO cross-walk (authority under review) — links open the control.

prevents

Secure coding standards require proper escaping and parameterization of commands, directly eliminating CWE-77.

detects

Security testing in development can detect unquoted search-path issues before deployment.

degrades

Enforcing controlled software installation can prevent unquoted search-path elements in executables and scripts.

prevents

Secure development lifecycle practices include input validation and path handling that reduce unquoted search-path weaknesses.

prevents

Application security requirements explicitly call for controls against injection flaws including command injection.

degrades

Secure system architecture and engineering principles require safe path construction and quoting conventions.

References