CVE-2024-12254: Unbounded memory buffering in SelectorSocketTransport.writelines()
Last updated 20 January 2025
Other sources
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
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/python3.11to a version that resolves this vulnerability.Fixed in 3.11.2-6+deb12u5Fixed in 3.11.2-6+deb12u3 - Upgrade
Upgrade
debian/python3.12to a version that resolves this vulnerability.Fixed in 3.12.8-5 - Upgrade
Upgrade
debian/python3.13to a version that resolves this vulnerability.Fixed in 3.13.1-3 - Upgrade
Upgrade
debian/python3.9to a version that resolves this vulnerability.Fixed in 3.9.2-1Fixed in 3.9.2-1+deb11u2
Event History
Frequently Asked Questions
What is the severity of CVE-2024-12254?
CVE-2024-12254 is classified with a medium severity due to potential performance issues in asynchronous socket communication.
How do I fix CVE-2024-12254?
To fix CVE-2024-12254, update Python to version 3.12.8-5 or the necessary patched version as specified for your distribution.
Which versions of Python are affected by CVE-2024-12254?
CVE-2024-12254 affects Python versions starting from 3.12.0 onward.
Is there a workaround for CVE-2024-12254?
Currently, there are no documented workarounds for CVE-2024-12254; upgrading to a patched version is recommended.
What components are impacted by CVE-2024-12254?
CVE-2024-12254 primarily affects the asyncio._SelectorSocketTransport.writelines() method in Python's asynchronous I/O framework.