CVE-2024-9287

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

At a glance

Severity
MEDIUM 5.3
EPSS
EPSS 0.65 % · percentile 51 (2026-10-27)
State
PUBLISHED
Published
Updated
Assigner
PSF
NVD status
Modified

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

VersionScoreVectorScored by
CVSS 4.0MEDIUM 5.3CVSS: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
CVSS 4.0MEDIUM 5.3CVSS: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:GreenNVD · cna@python.org (Secondary)
CVSS 3.1HIGH 7.8CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HNVD · nvd@nist.gov (Primary)

Weaknesses (CWE)

European references

CERT-FR advisories

Affected configurations (NVD CPE)

Affected products

ProductVersions
Python Software Foundation · CPythonaffected 0 < 3.9.21 ; affected 3.10.0 < 3.10.16 ; affected 3.11.0 < 3.11.11 ; affected 3.12.0 < 3.12.8 ; affected 3.13.0 < 3.13.1 ; affected 3.14.0a1 < 3.14.0a2

References

Sources

SourceLicence
CVE List (CVEProject cvelistV5)CVE Program Terms of Use
EPSS (FIRST.org)FIRST — attribution requested
ENISA EUVDENISA — reproduction authorised, source acknowledged
CERT-FR (ANSSI)Licence Ouverte / Etalab 2.0
NVD (NIST) via fkie-cad/nvd-json-data-feedsPublic domain — this product uses data from the NVD API but is not endorsed or certified by the NVD