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 48th percentile
Risk Priority 35 floored blend · peak EPSS

CVSS and EPSS are reproduced from their sources (NVD, FIRST EPSS). Risk Priority is our own derived reading, not an NVD score.

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, exploitation aligns with the MITRE ATT&CK technique Path Interception (T1034); ranked at the 48th percentile by exploit likelihood (below the median); it is not currently listed in the CISA KEV catalog.

The strongest mitigations our analysis identified map to SA-11 (Developer Testing and Evaluation) and SI-10 (Information Input Validation) — see the control section below for these in your framework.

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

MITRE ATT&CK Enterprise Techniques

T1034 Path Interception Persistence
**This technique has been deprecated.
T1059 Command and Scripting Interpreter Execution
Adversaries may abuse command and script interpreters to execute commands, scripts, or binaries.
T1190 Exploit Public-Facing Application Initial Access
Adversaries may attempt to exploit a weakness in an Internet-facing host or system to initially access a network.
T1059.001 PowerShell Execution
Adversaries may abuse PowerShell commands and scripts for execution.
T1059.003 Windows Command Shell Execution
Adversaries may abuse the Windows command shell for execution.
T1059.004 Unix Shell Execution
Adversaries may abuse Unix shell commands and scripts for execution.
Derived from this CVE’s CWE(s) via the direct CWE→ATT&CK cross-walk.

CVEs Like This One

CVE-2026-4519Same product: Python Python
CVE-2025-13462Same product: Python Python
CVE-2026-0864Same product: Python Python
CVE-2026-3644Same product: Python Python
CVE-2023-33595Same product: Python Python
CVE-2025-12781Same product: Python Python
CVE-2026-6019Same product: Python Python
CVE-2023-6507Same product: Python Python
CVE-2025-12084Same product: Python Python
CVE-2023-36632Same 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 800-53 r5) AI

Developer testing and evaluation can discover unquoted search paths through static analysis or dynamic test cases.

Input validation directly stops construction of commands from untrusted data containing special elements.

Documented development standards and tools can mandate proper quoting and escaping of path elements.

Engineering principles can require safe construction and quoting of search paths and command elements.

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.

finds

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