CVE-2024-9287

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

Published Oct 22, 2024 CVSS 4.0 · 5.3 Medium EPSS < 1% KEV · Not listed
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.

Remediation

No solution or workaround provided in the CVE record

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Debian DLA Debian DLA DLA-3966-1 pypy3 security update
Debian DLA Debian DLA DLA-3980-1 python3.9 security update
EUVD EUVD EUVD-2024-50376 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.
Ubuntu USN Ubuntu USN USN-7116-1 Python vulnerability
Ubuntu USN Ubuntu USN USN-7348-1 Python vulnerabilities
Ubuntu USN Ubuntu USN USN-7488-1 Python vulnerabilities
History
Type Values Removed Values Added
CPEs cpe:2.3:a:python:cpython:*:*:*:*:*:*:*:*
Vendors & Products Python cpython
Type Values Removed Values Added
Metrics epss

{'score': 0.00041}

epss

{'score': 0.00043}

Type Values Removed Values Added
First Time appeared Python python
Weaknesses CWE-77
CPEs cpe:2.3:a:python:python:*:*:*:*:*:*:*:*
cpe:2.3:a:python:python:3.14.0:alpha1:*:*:*:*:*:*
Vendors & Products Python python
Metrics cvssV3_1

{'score': 6.3, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:C/C:L/I:H/A:N'}

cvssV3_1

{'score': 7.8, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H'}

Type Values Removed Values Added
First Time appeared Redhat rhel Eus
CPEs cpe:/a:redhat:rhel_eus:9.4
Vendors & Products Redhat rhel Eus
Type Values Removed Values Added
CPEs cpe:/a:redhat:enterprise_linux:9
cpe:/o:redhat:enterprise_linux:9
Type Values Removed Values Added
First Time appeared Redhat
Redhat enterprise Linux
CPEs cpe:/a:redhat:enterprise_linux:8
cpe:/o:redhat:enterprise_linux:8
Vendors & Products Redhat
Redhat enterprise Linux
Type Values Removed Values Added
References
Metrics threat_severity

None

cvssV3_1

{'score': 6.3, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:C/C:L/I:H/A:N'}

threat_severity

Moderate

Type Values Removed Values Added
First Time appeared Python
Python cpython
CPEs cpe:2.3:a:python:cpython:*:*:*:*:*:*:*:*
Vendors & Products Python
Python cpython
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
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.
Title Virtual environment (venv) activation scripts don't quote paths
Weaknesses CWE-428
References
Metrics cvssV4_0

{'score': 5.3, 'vector': 'CVSS: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:Green'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
PSF
Published
Updated
Oct 30, 2026, 10:50 AM
Reserved
Sep 27, 2024, 2:48 PM
Status
Modified
Published
Oct 22, 2024, 5:15 PM
Modified
Oct 30, 2026, 11:17 AM
Severity
Moderate
Public date
Oct 22, 2024, 4:34 PM