CyberSecBulletin
CVE-2024-12254NVD status: Deferred

CPython: Uncontrolled Resource Consumption

CVE-2024-12254 is a high-severity uncontrolled resource consumption vulnerability in CPython from Python Software Foundation, with a CVSS 4.0 base score of 8.7 out of 10. It can be exploited remotely over the network by an unauthenticated attacker, without any action from a user. The record lists versions 3.12.9, 3.13.2, 3.14.0a3 as the first without the flaw, so updating CPython to one of those releases or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 1.87% chance of exploitation within 30 days, higher than 80% of scored CVEs.

Next patch cycle

High severity with no evidence of exploitation so far.

What to do

  1. Update CPython to 3.12.9 or 3.13.2 or 3.14.0a3 or 3.14.0a1, whichever matches your release line, or a later version.
  2. Until you can update, restrict network access to the affected service so it is not reachable from untrusted networks.

Affected products and versions

VendorProductAffected versionsFixed in
Python Software FoundationCPythonbefore 3.12.9; 3.13.0 up to, but not including, 3.13.2; 3.14.0a1 up to, but not including, 3.14.0a3; 3.12.0 up to, but not including, 3.14.0a13.12.9, 3.13.2, 3.14.0a3, 3.14.0a1

Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.

How the severity score breaks down

Attack vector
NetworkCan be exploited remotely over a network, including the internet.
Attack complexity
LowNo special conditions are needed; the attack works reliably.
Attack requirements
NoneThe attack does not depend on a particular deployment or configuration.
Privileges required
NoneNo account or login is needed.
User interaction
NoneNo action by a victim is required.
Confidentiality (vulnerable system)
NoneNo loss of confidentiality on the vulnerable system.
Integrity (vulnerable system)
NoneNo loss of integrity on the vulnerable system.
Availability (vulnerable system)
HighSerious loss of availability on the vulnerable system.
Confidentiality (other systems)
NoneNo loss of confidentiality on systems beyond the vulnerable one.
Integrity (other systems)
NoneNo loss of integrity on systems beyond the vulnerable one.
Availability (other systems)
NoneNo loss of availability on systems beyond the vulnerable one.

Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/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:X. Scored by CNA (python.org).

Scoring systemScoreSeverityScored by
CVSS 4.08.7HighCNA (python.org)
CVSS 3.17.5HighCISA (ADP)

Official description

Starting in Python 3.12.0, the asyncio._SelectorSocketTransport.writelines() method would not "pause" writing and signal to the Protocol to drain the buffer to the wire once the write buffer reached the "high-water mark". Because of this, Protocols would not periodically drain the write buffer potentially leading to memory exhaustion. This vulnerability likely impacts a small number of users, you must be using Python 3.12.0 or later, on macOS or Linux, using the asyncio module with protocols, and using .writelines() method which had new zero-copy-on-write behavior in Python 3.12.0 and later. If not all of these factors are true then your usage of Python is unaffected.

Source: the CVE record as published by its numbering authority, via NVD and CVE.org.

The underlying weakness: Uncontrolled Resource Consumption

The product does not properly control the allocation and maintenance of a limited resource.

How developers prevent this class of flaw

  • Ensure that protocols have specific limits of scale placed on them.
  • Ensure that all failures in resource allocation place the system into a safe posture.

More Uncontrolled Resource Consumption vulnerabilities (CWE-400)

Timeline

  1. CVE record published.
  2. CISA published its SSVC assessment (exploitation: none, automatable: yes, technical impact: partial).
  3. Record last changed materially (score, affected products, status or references).

References

Other vulnerabilities in CPython

All CPython vulnerabilities

Recent Uncontrolled Resource Consumption vulnerabilities

Spotted an error? Tell us.