CVE-2024-12254
JSON

8.7high

Unbounded memory buffering in SelectorSocketTransport.writelines()

Severity
8.7high CVSS:4.0 by PSF
Exploit likelihood
1.87% (higher than 79% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
PSF
Also known as
PSF-2024-14BIT-LIBPYTHON-2024-12254BIT-PYTHON-2024-12254BIT-PYTHON-MIN-2024-12254

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.

Affected

Product or packageVersionsReported by
Python Software Foundation CPythonbefore 3.12.9, from 3.13.0 before 3.13.2, from 3.14.0a1 before 3.14.0a3CVE List
python_software_foundation cpythonfrom 3.12.0 before 3.14.0a1CVE List
https://github.com/python/cpythonbefore 71e8429ac8e2adc10084ab5ec29a62f4b6671a82, before 9aa0deb2eef2655a1029ba228527b152353135b5, before e991ac8f2037d78140e417cc9a9486223eb3e786Python Software Foundation
libpython (Bitnami)from 3.12.0 before 3.12.9, from 3.13.0 before 3.13.2Bitnami Vulnerability Database
python (Bitnami)from 3.12.0 before 3.12.9, from 3.13.0 before 3.13.2Bitnami Vulnerability Database
python-min (Bitnami)from 3.12.0 before 3.12.9, from 3.13.0 before 3.13.2Bitnami Vulnerability Database

All scores

PSF8.7high CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
CISA-ADP7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Bitnami Vulnerability Databasehigh rating

Classification

CWE-400CWE-770

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

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.

NVD (es)

Starting de Python 3.12.0, el método asyncio._SelectorSocketTransport.writelines() no "pausaba" la escritura ni enviaba señales al protocolo para que vaciara el búfer hacia el cable una vez que el búfer de escritura alcanzaba el "límite superior". Debido a esto, los protocolos no vaciaban periódicamente el búfer de escritura, lo que podría provocar el agotamiento de la memoria. Es probable que esta vulnerabilidad afecte a una pequeña cantidad de usuarios. Debes usar Python 3.12.0 o posterior, en macOS o Linux, usar el módulo asyncio con protocolos y usar el método .writelines(), que tenía un nuevo comportamiento de copia cero al escribir en Python 3.12.0 y posterior. Si no se cumplen todos estos factores, tu uso de Python no se ve afectado.

References

Sources

SourceRecordLicence
CVE ListCVE-2024-12254 changed 2026-07-31CVE Terms of Use
Python Software FoundationPSF-2024-14 changed 2025-10-09CC-BY-4.0
NVDCVE-2024-12254 changed 2026-07-31Public domain
Bitnami Vulnerability DatabaseBIT-LIBPYTHON-2024-12254 changed 2025-08-11Apache-2.0
Bitnami Vulnerability DatabaseBIT-PYTHON-2024-12254 changed 2025-08-11Apache-2.0
Bitnami Vulnerability DatabaseBIT-PYTHON-MIN-2024-12254 changed 2025-08-11Apache-2.0