Miggo Logo

CVE-2024-9287: A vulnerability has been found in the CPython `venv` module and CLI where path names provided...

7.8

CVSS Score
3.1

Basic Information

EPSS Score
0.11741%
Published
10/22/2024
Updated
4/26/2025
KEV Status
No
Technology
-

Technical Details

CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability is a command injection in CPython's venv module due to improperly quoted path names in activation scripts. The analysis focused on identifying functions involved in processing user-supplied paths and generating these scripts.

  1. venv.EnvBuilder.replace_variables is identified as the core vulnerable function because it performed direct string substitutions of user input (like environment paths) into script templates without quoting.
  2. venv.EnvBuilder.install_scripts is crucial as it calls replace_variables and writes the processed (and previously vulnerable) script content to disk.
  3. venv.EnvBuilder.create is the main API method in EnvBuilder that accepts the user-provided, potentially malicious, environment path, starting the vulnerable workflow.
  4. venv.main (from Lib/venv/__main__.py) is the CLI entry point that parses the user's input (including the environment path) and passes it to EnvBuilder.create. These functions would appear in a runtime profile during the creation of a virtual environment, and their interaction led to the vulnerability when unquoted, malicious path names were used.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

* vuln*r**ility **s ***n *oun* in t** *Pyt*on `v*nv` mo*ul* *n* *LI w**r* p*t* n*m*s provi*** w**n *r**tin* * virtu*l *nvironm*nt w*r* not quot** prop*rly, *llowin* t** *r**tor to inj**t *omm*n*s into virtu*l *nvironm*nt "**tiv*tion" s*ripts (i* "sou

Reasoning

T** vuln*r**ility is * *omm*n* inj**tion in *Pyt*on's `v*nv` mo*ul* *u* to improp*rly quot** p*t* n*m*s in **tiv*tion s*ripts. T** *n*lysis *o*us** on i**nti*yin* *un*tions involv** in pro**ssin* us*r-suppli** p*t*s *n* **n*r*tin* t**s* s*ripts. *.