Skip to main content
← All vulnerabilities
CVE-2024-9287

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

Published
Last modified
published
Not listed in CISA KEV
Fix
Fixed in 3.9.21, 3.10.16, 3.11.11, 3.12.8, 3.13.1, and 1 more
None on Exploit-DB, Metasploit or GitHub
  • Exploitation: none
  • Automatable: no
  • Technical impact: total

Summary

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.

Timeline

  1. CVE published
  2. CISA SSVC assessment

    Exploitation: none · Automatable: no · Technical impact: total

  3. Record last updated

Affected versions

  • Python Software Foundation CPython

    fixed in 3.9.21; From 3.10.0 · fixed in 3.10.16; From 3.11.0 · fixed in 3.11.11; From 3.12.0 · fixed in 3.12.8; From 3.13.0 · fixed in 3.13.1; From 3.14.0a1 · fixed in 3.14.0a2

References 9

GitHub · python/cpython

mail.python.org