CVE-2024-12254Unbounded memory buffering in SelectorSocketTransport.writelines()
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.
What to do
Fixed builds are available from AlmaLinux, Alpine, Debian, Red Hat, Rocky Linux, Ubuntu: see the table below for the fixed version per release.
Ubuntu has not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 25.10 | python3.13 | Not affected vulnerable_code_not_present | ||
| Ubuntu 24.04 | python3.12 | Fixed | 3.12.3-1ubuntu0.4 | UBUNTU-CVE-2024-12254 |
| Ubuntu 22.04 | python3.10 | Not affected vulnerable_code_not_present | ||
| Ubuntu 16.04 | python2.7 | Fix pending | ||
| Ubuntu 16.04 | python3.5 | Fix pending | ||
| Debian 13 | python3.13 | Fixed | 3.13.1-2 | DEBIAN-CVE-2024-12254 |
| Red Hat Enterprise Linux 10 | python-unversioned-command | Fixed | 0:3.12.9-1.el10 | RHBA-2025:6294 |
| Red Hat Enterprise Linux 10 | python3 | Fixed | 0:3.12.9-1.el10 | RHBA-2025:6294 |
| Red Hat Enterprise Linux 10 | python3-debug | Fixed | 0:3.12.9-1.el10 | RHBA-2025:6294 |
| Red Hat Enterprise Linux 10 | python3-devel | Fixed | 0:3.12.9-1.el10 | RHBA-2025:6294 |
| Red Hat Enterprise Linux 10 | python3-idle | Fixed | 0:3.12.9-1.el10 | RHBA-2025:6294 |
| Red Hat Enterprise Linux 10 | python3-libs | Fixed | 0:3.12.9-1.el10 | RHBA-2025:6294 |
| Red Hat Enterprise Linux 10 | python3-test | Fixed | 0:3.12.9-1.el10 | RHBA-2025:6294 |
| Red Hat Enterprise Linux 10 | python3-tkinter | Fixed | 0:3.12.9-1.el10 | RHBA-2025:6294 |
| Red Hat Enterprise Linux 10 | python3.12 | Fixed | 0:3.12.9-1.el10 | RHBA-2025:6294 |
| Red Hat Enterprise Linux 9 | python-unversioned-command | Not affected | ||
| Red Hat Enterprise Linux 9 | python3 | Not affected | ||
| Red Hat Enterprise Linux 9 | python3-debug | Not affected | ||
| Red Hat Enterprise Linux 9 | python3-devel | Not affected | ||
| Red Hat Enterprise Linux 9 | python3-idle | Not affected | ||
| Red Hat Enterprise Linux 9 | python3-libs | Not affected | ||
| Red Hat Enterprise Linux 9 | python3-test | Not affected | ||
| Red Hat Enterprise Linux 9 | python3-tkinter | Not affected | ||
| Red Hat Enterprise Linux 9 | python3.11 | Not affected | ||
| Red Hat Enterprise Linux 9 | python3.11-debug | Not affected | ||
| Red Hat Enterprise Linux 9 | python3.11-devel | Not affected | ||
| Red Hat Enterprise Linux 9 | python3.11-idle | Not affected | ||
| Red Hat Enterprise Linux 9 | python3.11-libs | Not affected | ||
| Red Hat Enterprise Linux 9 | python3.11-test | Not affected | ||
| Red Hat Enterprise Linux 9 | python3.11-tkinter | Not affected | ||
| Red Hat Enterprise Linux 9 | python3.12 | Fixed | 0:3.12.5-2.el9_5.2 | RHSA-2024:10978 |
| Red Hat Enterprise Linux 9 | python3.12-debug | Fixed | 0:3.12.5-2.el9_5.2 | RHSA-2024:10978 |
| Red Hat Enterprise Linux 9 | python3.12-devel | Fixed | 0:3.12.5-2.el9_5.2 | RHSA-2024:10978 |
| Red Hat Enterprise Linux 9 | python3.12-idle | Fixed | 0:3.12.5-2.el9_5.2 | RHSA-2024:10978 |
| Red Hat Enterprise Linux 9 | python3.12-libs | Fixed | 0:3.12.5-2.el9_5.2 | RHSA-2024:10978 |
| Red Hat Enterprise Linux 9 | python3.12-test | Fixed | 0:3.12.5-2.el9_5.2 | RHSA-2024:10978 |
| Red Hat Enterprise Linux 9 | python3.12-tkinter | Fixed | 0:3.12.5-2.el9_5.2 | RHSA-2024:10978 |
| Red Hat Enterprise Linux 9 | python3.9 | Not affected | ||
| Red Hat Enterprise Linux 8 | PyYAML | Not affected | ||
| Red Hat Enterprise Linux 8 | mod_wsgi | Not affected | ||
| Red Hat Enterprise Linux 8 | numpy | Not affected | ||
| Red Hat Enterprise Linux 8 | platform-python | Not affected | ||
| Red Hat Enterprise Linux 8 | platform-python-debug | Not affected | ||
| Red Hat Enterprise Linux 8 | platform-python-devel | Not affected | ||
| Red Hat Enterprise Linux 8 | python-PyMySQL | Not affected | ||
| Red Hat Enterprise Linux 8 | python-cffi | Not affected | ||
| Red Hat Enterprise Linux 8 | python-chardet | Not affected | ||
| Red Hat Enterprise Linux 8 | python-cryptography | Not affected | ||
| Red Hat Enterprise Linux 8 | python-distro | Not affected | ||
| Red Hat Enterprise Linux 8 | python-docs | Not affected | ||
| Red Hat Enterprise Linux 8 | python-docutils | Not affected | ||
| Red Hat Enterprise Linux 8 | python-idna | Not affected | ||
| Red Hat Enterprise Linux 8 | python-lxml | Not affected | ||
| Red Hat Enterprise Linux 8 | python-nose | Not affected | ||
| Red Hat Enterprise Linux 8 | python-nose-docs | Not affected | ||
| Red Hat Enterprise Linux 8 | python-ply | Not affected | ||
| Red Hat Enterprise Linux 8 | python-psutil | Not affected | ||
| Red Hat Enterprise Linux 8 | python-psycopg2 | Not affected | ||
| Red Hat Enterprise Linux 8 | python-pycparser | Not affected | ||
| Red Hat Enterprise Linux 8 | python-pygments | Not affected | ||
| Red Hat Enterprise Linux 8 | python-pymongo | Not affected | ||
| Red Hat Enterprise Linux 8 | python-pymongo-doc | Not affected | ||
| Red Hat Enterprise Linux 8 | python-pysocks | Not affected | ||
| Red Hat Enterprise Linux 8 | python-requests | Not affected | ||
| Red Hat Enterprise Linux 8 | python-sqlalchemy | Not affected | ||
| Red Hat Enterprise Linux 8 | python-sqlalchemy-doc | Not affected | ||
| Red Hat Enterprise Linux 8 | python-toml | Not affected | ||
| Red Hat Enterprise Linux 8 | python-urllib3 | Not affected | ||
| Red Hat Enterprise Linux 8 | python-virtualenv | Not affected | ||
| Red Hat Enterprise Linux 8 | python-virtualenv-doc | Not affected | ||
| Red Hat Enterprise Linux 8 | python-wheel | Not affected | ||
| Red Hat Enterprise Linux 8 | python2 | Not affected | ||
| Red Hat Enterprise Linux 8 | python2-debug | Not affected | ||
| Red Hat Enterprise Linux 8 | python2-devel | Not affected | ||
| Red Hat Enterprise Linux 8 | python2-libs | Not affected | ||
| Red Hat Enterprise Linux 8 | python2-test | Not affected | ||
| Red Hat Enterprise Linux 8 | python2-tkinter | Not affected | ||
| Red Hat Enterprise Linux 8 | python2-tools | Not affected | ||
| Red Hat Enterprise Linux 8 | python3 | Not affected | ||
| Red Hat Enterprise Linux 8 | python3-PyMySQL | Not affected | ||
| Red Hat Enterprise Linux 8 | python3-bson | Not affected | ||
| Red Hat Enterprise Linux 8 | python3-distro | Not affected | ||
| Red Hat Enterprise Linux 8 | python3-docs | Not affected | ||
| Red Hat Enterprise Linux 8 | python3-docutils | Not affected | ||
| Red Hat Enterprise Linux 8 | python3-idle | Not affected | ||
| Red Hat Enterprise Linux 8 | python3-libs | Not affected | ||
| Red Hat Enterprise Linux 8 | python3-nose | Not affected | ||
| Red Hat Enterprise Linux 8 | python3-pygments | Not affected | ||
| Red Hat Enterprise Linux 8 | python3-pymongo | Not affected | ||
| Red Hat Enterprise Linux 8 | python3-pymongo-gridfs | Not affected | ||
| Red Hat Enterprise Linux 8 | python3-scipy | Not affected | ||
| Red Hat Enterprise Linux 8 | python3-sqlalchemy | Not affected | ||
| Red Hat Enterprise Linux 8 | python3-test | Not affected | ||
| Red Hat Enterprise Linux 8 | python3-tkinter | Not affected | ||
| Red Hat Enterprise Linux 8 | python3-virtualenv | Not affected | ||
| Red Hat Enterprise Linux 8 | python3-wheel | Not affected | ||
| Red Hat Enterprise Linux 8 | python3-wheel-wheel | Not affected | ||
| Red Hat Enterprise Linux 8 | python3.11 | Not affected | ||
| Red Hat Enterprise Linux 8 | python3.11-debug | Not affected | ||
| Red Hat Enterprise Linux 8 | python3.11-devel | Not affected | ||
| Red Hat Enterprise Linux 8 | python3.11-idle | Not affected | ||
| Red Hat Enterprise Linux 8 | python3.11-libs | Not affected | ||
| Red Hat Enterprise Linux 8 | python3.11-rpm-macros | Not affected | ||
| Red Hat Enterprise Linux 8 | python3.11-test | Not affected | ||
| Red Hat Enterprise Linux 8 | python3.11-tkinter | Not affected | ||
| Red Hat Enterprise Linux 8 | python3.12 | Fixed | 0:3.12.8-1.el8_10 | RHSA-2024:10980 |
| Red Hat Enterprise Linux 8 | python3.12-debug | Fixed | 0:3.12.8-1.el8_10 | RHSA-2024:10980 |
| Red Hat Enterprise Linux 8 | python3.12-devel | Fixed | 0:3.12.8-1.el8_10 | RHSA-2024:10980 |
| Red Hat Enterprise Linux 8 | python3.12-idle | Fixed | 0:3.12.8-1.el8_10 | RHSA-2024:10980 |
| Red Hat Enterprise Linux 8 | python3.12-libs | Fixed | 0:3.12.8-1.el8_10 | RHSA-2024:10980 |
| Red Hat Enterprise Linux 8 | python3.12-rpm-macros | Fixed | 0:3.12.8-1.el8_10 | RHSA-2024:10980 |
| Red Hat Enterprise Linux 8 | python3.12-test | Fixed | 0:3.12.8-1.el8_10 | RHSA-2024:10980 |
| Red Hat Enterprise Linux 8 | python3.12-tkinter | Fixed | 0:3.12.8-1.el8_10 | RHSA-2024:10980 |
| Red Hat Enterprise Linux 8 | python36 | Not affected | ||
| Red Hat Enterprise Linux 8 | python36-debug | Not affected | ||
| Red Hat Enterprise Linux 8 | python36-devel | Not affected | ||
| Red Hat Enterprise Linux 8 | python36-rpm-macros | Not affected | ||
| Red Hat Enterprise Linux 8 | python39 | Not affected | ||
| Red Hat Enterprise Linux 8 | python39-PyMySQL | Not affected | ||
| Red Hat Enterprise Linux 8 | python39-cffi | Not affected | ||
| Red Hat Enterprise Linux 8 | python39-chardet | Not affected | ||
| Red Hat Enterprise Linux 8 | python39-cryptography | Not affected | ||
| Red Hat Enterprise Linux 8 | python39-devel | Not affected | ||
| Red Hat Enterprise Linux 8 | python39-idle | Not affected | ||
| Red Hat Enterprise Linux 8 | python39-idna | Not affected | ||
| Red Hat Enterprise Linux 8 | python39-libs | Not affected | ||
| Red Hat Enterprise Linux 8 | python39-lxml | Not affected | ||
| Red Hat Enterprise Linux 8 | python39-mod_wsgi | Not affected | ||
| Red Hat Enterprise Linux 8 | python39-numpy | Not affected | ||
| Red Hat Enterprise Linux 8 | python39-numpy-doc | Not affected | ||
| Red Hat Enterprise Linux 8 | python39-numpy-f2py | Not affected | ||
| Red Hat Enterprise Linux 8 | python39-pip | Not affected | ||
| Red Hat Enterprise Linux 8 | python39-pip-wheel | Not affected | ||
| Red Hat Enterprise Linux 8 | python39-ply | Not affected | ||
| Red Hat Enterprise Linux 8 | python39-psutil | Not affected | ||
| Red Hat Enterprise Linux 8 | python39-psycopg2 | Not affected | ||
| Red Hat Enterprise Linux 8 | python39-psycopg2-doc | Not affected | ||
| Red Hat Enterprise Linux 8 | python39-psycopg2-tests | Not affected | ||
| Red Hat Enterprise Linux 8 | python39-pycparser | Not affected | ||
| Red Hat Enterprise Linux 8 | python39-pysocks | Not affected | ||
| Red Hat Enterprise Linux 8 | python39-pyyaml | Not affected | ||
| Red Hat Enterprise Linux 8 | python39-requests | Not affected | ||
| Red Hat Enterprise Linux 8 | python39-rpm-macros | Not affected | ||
| Red Hat Enterprise Linux 8 | python39-scipy | Not affected | ||
| Red Hat Enterprise Linux 8 | python39-setuptools | Not affected | ||
| Red Hat Enterprise Linux 8 | python39-setuptools-wheel | Not affected | ||
| Red Hat Enterprise Linux 8 | python39-six | Not affected | ||
| Red Hat Enterprise Linux 8 | python39-test | Not affected | ||
| Red Hat Enterprise Linux 8 | python39-tkinter | Not affected | ||
| Red Hat Enterprise Linux 8 | python39-toml | Not affected | ||
| Red Hat Enterprise Linux 8 | python39-urllib3 | Not affected | ||
| Red Hat Enterprise Linux 8 | python39-wheel | Not affected | ||
| Red Hat Enterprise Linux 8 | python39-wheel-wheel | Not affected | ||
| Red Hat Enterprise Linux 8 | python3x-pip | Not affected | ||
| Red Hat Enterprise Linux 8 | python3x-setuptools | Not affected | ||
| Red Hat Enterprise Linux 8 | python3x-six | Not affected | ||
| Red Hat Enterprise Linux 8 | scipy | Not affected | ||
| Red Hat Enterprise Linux 7 | python | Not affected | ||
| Red Hat Enterprise Linux 7 | python-debug | Not affected | ||
| Red Hat Enterprise Linux 7 | python-devel | Not affected | ||
| Red Hat Enterprise Linux 7 | python-libs | Not affected | ||
| Red Hat Enterprise Linux 7 | python-test | Not affected | ||
| Red Hat Enterprise Linux 7 | python-tools | Not affected | ||
| Red Hat Enterprise Linux 7 | python3 | Not affected | ||
| Red Hat Enterprise Linux 7 | python3-debug | Not affected | ||
| Red Hat Enterprise Linux 7 | python3-devel | Not affected | ||
| Red Hat Enterprise Linux 7 | python3-idle | Not affected | ||
| Red Hat Enterprise Linux 7 | python3-libs | Not affected | ||
| Red Hat Enterprise Linux 7 | python3-test | Not affected | ||
| Red Hat Enterprise Linux 7 | python3-tkinter | Not affected | ||
| Red Hat Enterprise Linux 7 | tkinter | Not affected | ||
| Red Hat Enterprise Linux 6 | python | Not affected | ||
| Red Hat Enterprise Linux 6 | python-devel | Not affected | ||
| Red Hat Enterprise Linux 6 | python-libs | Not affected | ||
| Red Hat Enterprise Linux 6 | python-test | Not affected | ||
| Red Hat Enterprise Linux 6 | python-tools | Not affected | ||
| Red Hat Enterprise Linux 6 | tkinter | Not affected | ||
| AlmaLinux 9 | python3.12 | Fixed | 3.12.5-2.el9_5.2 | ALSA-2024:10978 |
| AlmaLinux 9 | python3.12-debug | Fixed | 3.12.5-2.el9_5.2 | ALSA-2024:10978 |
| AlmaLinux 9 | python3.12-devel | Fixed | 3.12.5-2.el9_5.2 | ALSA-2024:10978 |
| AlmaLinux 9 | python3.12-idle | Fixed | 3.12.5-2.el9_5.2 | ALSA-2024:10978 |
| AlmaLinux 9 | python3.12-libs | Fixed | 3.12.5-2.el9_5.2 | ALSA-2024:10978 |
| AlmaLinux 9 | python3.12-test | Fixed | 3.12.5-2.el9_5.2 | ALSA-2024:10978 |
| AlmaLinux 9 | python3.12-tkinter | Fixed | 3.12.5-2.el9_5.2 | ALSA-2024:10978 |
| AlmaLinux 8 | python3.12 | Fixed | 3.12.8-1.el8_10 | ALSA-2024:10980 |
| AlmaLinux 8 | python3.12-debug | Fixed | 3.12.8-1.el8_10 | ALSA-2024:10980 |
| AlmaLinux 8 | python3.12-devel | Fixed | 3.12.8-1.el8_10 | ALSA-2024:10980 |
| AlmaLinux 8 | python3.12-idle | Fixed | 3.12.8-1.el8_10 | ALSA-2024:10980 |
| AlmaLinux 8 | python3.12-libs | Fixed | 3.12.8-1.el8_10 | ALSA-2024:10980 |
| AlmaLinux 8 | python3.12-rpm-macros | Fixed | 3.12.8-1.el8_10 | ALSA-2024:10980 |
| AlmaLinux 8 | python3.12-test | Fixed | 3.12.8-1.el8_10 | ALSA-2024:10980 |
| AlmaLinux 8 | python3.12-tkinter | Fixed | 3.12.8-1.el8_10 | ALSA-2024:10980 |
| Rocky Linux 9 | python3.12 | Fixed | 0:3.12.5-2.el9_5.2 | RLSA-2024:10978 |
| Rocky Linux 8 | python3.12 | Fixed | 0:3.12.8-1.el8_10 | RLSA-2024:10980 |
| Alpine Linux 3.24 | python3 | Fixed | 3.12.8-r1 | ALPINE-CVE-2024-12254 |
| Alpine Linux 3.23 | python3 | Fixed | 3.12.8-r1 | ALPINE-CVE-2024-12254 |
| Alpine Linux 3.22 | python3 | Fixed | 3.12.8-r1 | ALPINE-CVE-2024-12254 |
| Alpine Linux 3.21 | python3 | Fixed | 3.12.8-r1 | ALPINE-CVE-2024-12254 |
| Alpine Linux 3.20 | python3 | Fixed | 3.12.8-r1 | ALPINE-CVE-2024-12254 |
What the vendor says
As published in the CVE record by PSF, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- Python Software Foundation CPython: affected: before 3.12.9, 3.13.0 to before 3.13.2, 3.14.0a1 to before 3.14.0a3; fixed in
3.12.9,3.13.2,3.14.0a3
Vendor advisories:
- https://github.com/python/cpython/pull/127656 (patch)
- https://mail.python.org/archives/list/security-announce@python.org/thread/H4O3UBAOAQQXGT4… (vendor-advisory)
- https://github.com/python/cpython/commit/71e8429ac8e2adc10084ab5ec29a62f4b6671a82 (patch)
- https://github.com/python/cpython/commit/9aa0deb2eef2655a1029ba228527b152353135b5 (patch)
- https://github.com/python/cpython/commit/e991ac8f2037d78140e417cc9a9486223eb3e786 (patch)
References
- https://github.com/python/cpython/issues/127655
- https://github.com/python/cpython/pull/127656
- https://mail.python.org/archives/list/security-announce@python.org/thread/H4O3UBAOAQQXGT4RE3E4XQYR5XLROORB/
- https://github.com/python/cpython/commit/71e8429ac8e2adc10084ab5ec29a62f4b6671a82
- https://github.com/python/cpython/commit/9aa0deb2eef2655a1029ba228527b152353135b5
- https://github.com/python/cpython/commit/e991ac8f2037d78140e417cc9a9486223eb3e786
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.