Skip to content

CVE-2024-12254 Unbounded memory buffering in SelectorSocketTransport.writelines()

HighCVSS 8.7 EPSS 1.9%
Published
Updated
Exploit status
No public exploit known
CISA SSVC
No known exploitation · automatable: yes · technical impact: partial
Technology
UbuntuDebian

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.

Upgrade path

9 packages: 9 fixed.

PackageAffectedFixed inStatus
alpine/python3(Alpine v3.20) < 3.12.8-r1 3.12.8-r1 Fixed
alpine/python3(Alpine v3.21) < 3.12.8-r1 3.12.8-r1 Fixed
alpine/python3(Alpine v3.22) < 3.12.8-r1 3.12.8-r1 Fixed
alpine/python3(Alpine v3.23) < 3.12.8-r1 3.12.8-r1 Fixed
alpine/python3(Alpine v3.24) < 3.12.8-r1 3.12.8-r1 Fixed
azure linux python3(Azure Linux 3.0) < 3.12.3-5 3.12.3-5 Fixed
debian/python3.13(Debian 13) < 3.13.1-2 3.13.1-2 Fixed
Python Software Foundation CPython < 3.12.9; >= 3.12.0, < 3.14.0a1; >= 3.13.0, < 3.13.2; >= 3.14.0a1, < 3.14.0a3 3.12.9, 3.13.2, 3.14.0a1, 3.14.0a3 Fixed
ubuntu/python3.12(Ubuntu 24.04) < 3.12.3-1ubuntu0.4; = 3.12.0-1; = 3.12.0-5; = 3.12.0-6 +10 more 3.12.3-1ubuntu0.4 Fixed

Affected products

ProductAffected versionsFixed in
azure linux python3(Azure Linux:3.0) < 3.12.3-5 3.12.3-5
debian/python3.13(Debian:13) < 3.13.1-2 3.13.1-2
Python Software Foundation CPython < 3.12.9 3.12.9
Python Software Foundation CPython >= 3.13.0, < 3.13.2 3.13.2
Python Software Foundation CPython >= 3.14.0a1, < 3.14.0a3 3.14.0a3
Python Software Foundation CPython >= 3.12.0, < 3.14.0a1 3.14.0a1
alpine/python3(Alpine:v3.20) < 3.12.8-r1 3.12.8-r1
alpine/python3(Alpine:v3.21) < 3.12.8-r1 3.12.8-r1
alpine/python3(Alpine:v3.22) < 3.12.8-r1 3.12.8-r1
alpine/python3(Alpine:v3.23) < 3.12.8-r1 3.12.8-r1
alpine/python3(Alpine:v3.24) < 3.12.8-r1 3.12.8-r1
ubuntu/python3.12(Ubuntu:24.04) < 3.12.3-1ubuntu0.4 3.12.3-1ubuntu0.4
ubuntu/python3.12(Ubuntu:24.04) = 3.12.0-1 No fix listed
ubuntu/python3.12(Ubuntu:24.04) = 3.12.0-5 No fix listed
ubuntu/python3.12(Ubuntu:24.04) = 3.12.0-6 No fix listed
ubuntu/python3.12(Ubuntu:24.04) = 3.12.0-7 No fix listed
ubuntu/python3.12(Ubuntu:24.04) = 3.12.1-2 No fix listed
ubuntu/python3.12(Ubuntu:24.04) = 3.12.2-1 No fix listed
ubuntu/python3.12(Ubuntu:24.04) = 3.12.2-4build3 No fix listed
ubuntu/python3.12(Ubuntu:24.04) = 3.12.2-4build4 No fix listed
ubuntu/python3.12(Ubuntu:24.04) = 3.12.2-5ubuntu3 No fix listed
ubuntu/python3.12(Ubuntu:24.04) = 3.12.3-1 No fix listed
ubuntu/python3.12(Ubuntu:24.04) = 3.12.3-1ubuntu0.1 No fix listed
ubuntu/python3.12(Ubuntu:24.04) = 3.12.3-1ubuntu0.2 No fix listed
ubuntu/python3.12(Ubuntu:24.04) = 3.12.3-1ubuntu0.3 No fix listed

References