CVE-2024-9287

Virtual environment (venv) activation scripts don't quote paths

State
Published
Severity
5.3 Medium
Published
Oct 22, 2024
Updated
Oct 30, 2026
Reserved
Sep 27, 2024

Read the record on cve.org

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.

Scores

CVSSScoreVectorSource
4.05.3 MediumCVSS:4.0/AV:L/AC:L/AT:P/PR:H/UI:A/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N/U:GreenPSF

Weaknesses

  • CWE-428 Unquoted Search Path or Element

Affected Products

ProductVersions
CPythonPython Software Foundation
  • before 3.9.21Affected
  • 3.10.0 to before 3.10.16Affected
  • 3.11.0 to before 3.11.11Affected
  • 3.12.0 to before 3.12.8Affected
  • 3.13.0 to before 3.13.1Affected
  • 3.14.0a1 to before 3.14.0a2Affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.