7.8
HIGH
CVE-2024-9287
"Python CPython venv Command Injection Vulnerability"
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.

INFO

Published Date :

Oct. 22, 2024, 5:15 p.m.

Last Modified :

Feb. 10, 2025, 6:47 p.m.

Remotely Exploitable :

No

Impact Score :

5.9

Exploitability Score :

1.8
Affected Products

The following products are affected by CVE-2024-9287 vulnerability. Even if cvefeed.io is aware of the exact versions of the products that are affected, the information is not represented in the table below.

ID Vendor Product Action
1 Python python

We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).

Results are limited to the first 15 repositories due to potential performance issues.

The following list is the news that have been mention CVE-2024-9287 vulnerability anywhere in the article.

The following table lists the changes that have been made to the CVE-2024-9287 vulnerability over time.

Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.

  • Initial Analysis by [email protected]

    Feb. 10, 2025

    Action Type Old Value New Value
    Added CVSS V3.1 NIST AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
    Added CWE NIST CWE-77
    Added CPE Configuration OR *cpe:2.3:a:python:python:*:*:*:*:*:*:*:* versions up to (excluding) 3.9.21 *cpe:2.3:a:python:python:*:*:*:*:*:*:*:* versions from (including) 3.10.0 up to (excluding) 3.10.16 *cpe:2.3:a:python:python:*:*:*:*:*:*:*:* versions from (including) 3.11.0 up to (excluding) 3.11.11 *cpe:2.3:a:python:python:*:*:*:*:*:*:*:* versions from (including) 3.12.0 up to (excluding) 3.12.8 *cpe:2.3:a:python:python:*:*:*:*:*:*:*:* versions from (including) 3.13.0 up to (excluding) 3.13.1 *cpe:2.3:a:python:python:3.14.0:alpha1:*:*:*:*:*:*
    Changed Reference Type https://github.com/python/cpython/commit/633555735a023d3e4d92ba31da35b1205f9ecbd7 No Types Assigned https://github.com/python/cpython/commit/633555735a023d3e4d92ba31da35b1205f9ecbd7 Patch
    Changed Reference Type https://github.com/python/cpython/commit/8450b2482586857d689b6658f08de9c8179af7db No Types Assigned https://github.com/python/cpython/commit/8450b2482586857d689b6658f08de9c8179af7db Patch
    Changed Reference Type https://github.com/python/cpython/commit/9286ab3a107ea41bd3f3c3682ce2512692bdded8 No Types Assigned https://github.com/python/cpython/commit/9286ab3a107ea41bd3f3c3682ce2512692bdded8 Patch
    Changed Reference Type https://github.com/python/cpython/commit/ae961ae94bf19c8f8c7fbea3d1c25cc55ce8ae97 No Types Assigned https://github.com/python/cpython/commit/ae961ae94bf19c8f8c7fbea3d1c25cc55ce8ae97 Patch
    Changed Reference Type https://github.com/python/cpython/commit/d48cc82ed25e26b02eb97c6263d95dcaa1e9111b No Types Assigned https://github.com/python/cpython/commit/d48cc82ed25e26b02eb97c6263d95dcaa1e9111b Patch
    Changed Reference Type https://github.com/python/cpython/commit/e52095a0c1005a87eed2276af7a1f2f66e2b6483 No Types Assigned https://github.com/python/cpython/commit/e52095a0c1005a87eed2276af7a1f2f66e2b6483 Patch
    Changed Reference Type https://github.com/python/cpython/issues/124651 No Types Assigned https://github.com/python/cpython/issues/124651 Issue Tracking
    Changed Reference Type https://github.com/python/cpython/pull/124712 No Types Assigned https://github.com/python/cpython/pull/124712 Issue Tracking, Patch
    Changed Reference Type https://mail.python.org/archives/list/[email protected]/thread/RSPJ2B5JL22FG3TKUJ7D7DQ4N5JRRBZL/ No Types Assigned https://mail.python.org/archives/list/[email protected]/thread/RSPJ2B5JL22FG3TKUJ7D7DQ4N5JRRBZL/ Vendor Advisory
  • CVE Modified by [email protected]

    Jan. 31, 2025

    Action Type Old Value New Value
    Added Reference https://github.com/python/cpython/commit/d48cc82ed25e26b02eb97c6263d95dcaa1e9111b
  • CVE Modified by [email protected]

    Nov. 04, 2024

    Action Type Old Value New Value
    Added Reference Python Software Foundation https://github.com/python/cpython/commit/633555735a023d3e4d92ba31da35b1205f9ecbd7 [No types assigned]
    Added Reference Python Software Foundation https://github.com/python/cpython/commit/8450b2482586857d689b6658f08de9c8179af7db [No types assigned]
    Added Reference Python Software Foundation https://github.com/python/cpython/commit/9286ab3a107ea41bd3f3c3682ce2512692bdded8 [No types assigned]
    Added Reference Python Software Foundation https://github.com/python/cpython/commit/ae961ae94bf19c8f8c7fbea3d1c25cc55ce8ae97 [No types assigned]
  • CVE Modified by [email protected]

    Oct. 30, 2024

    Action Type Old Value New Value
    Added Reference Python Software Foundation https://github.com/python/cpython/commit/e52095a0c1005a87eed2276af7a1f2f66e2b6483 [No types assigned]
  • CVE Received by [email protected]

    Oct. 22, 2024

    Action Type Old Value New Value
    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.
    Added Reference Python Software Foundation https://github.com/python/cpython/issues/124651 [No types assigned]
    Added Reference Python Software Foundation https://github.com/python/cpython/pull/124712 [No types assigned]
    Added Reference Python Software Foundation https://mail.python.org/archives/list/[email protected]/thread/RSPJ2B5JL22FG3TKUJ7D7DQ4N5JRRBZL/ [No types assigned]
    Added CWE Python Software Foundation CWE-428
    Added CVSS V4.0 Python Software Foundation 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/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:Green
EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days. Following chart shows the EPSS score history of the vulnerability.
CWE - Common Weakness Enumeration

While CVE identifies specific instances of vulnerabilities, CWE categorizes the common flaws or weaknesses that can lead to vulnerabilities. CVE-2024-9287 is associated with the following CWEs:

CVSS31 - Vulnerability Scoring System
Attack Vector
Attack Complexity
Privileges Required
User Interaction
Scope
Confidentiality
Integrity
Availability