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 package | Versions | Reported by |
|---|---|---|
| Python Software Foundation CPython | before 3.12.9, from 3.13.0 before 3.13.2, from 3.14.0a1 before 3.14.0a3 | CVE List |
| python_software_foundation cpython | from 3.12.0 before 3.14.0a1 | CVE List |
| https://github.com/python/cpython | before 71e8429ac8e2adc10084ab5ec29a62f4b6671a82, before 9aa0deb2eef2655a1029ba228527b152353135b5, before e991ac8f2037d78140e417cc9a9486223eb3e786 | Python Software Foundation |
| libpython (Bitnami) | from 3.12.0 before 3.12.9, from 3.13.0 before 3.13.2 | Bitnami Vulnerability Database |
| python (Bitnami) | from 3.12.0 before 3.12.9, from 3.13.0 before 3.13.2 | Bitnami Vulnerability Database |
| python-min (Bitnami) | from 3.12.0 before 3.12.9, from 3.13.0 before 3.13.2 | Bitnami Vulnerability Database |
All scores
| PSF | 8.7high CVSS:4.0 | 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 |
| CISA-ADP | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| Bitnami Vulnerability Database | high rating |
Classification
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
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-12254 changed 2026-07-31 | CVE Terms of Use |
| Python Software Foundation | PSF-2024-14 changed 2025-10-09 | CC-BY-4.0 |
| NVD | CVE-2024-12254 changed 2026-07-31 | Public domain |
| Bitnami Vulnerability Database | BIT-LIBPYTHON-2024-12254 changed 2025-08-11 | Apache-2.0 |
| Bitnami Vulnerability Database | BIT-PYTHON-2024-12254 changed 2025-08-11 | Apache-2.0 |
| Bitnami Vulnerability Database | BIT-PYTHON-MIN-2024-12254 changed 2025-08-11 | Apache-2.0 |