Unbounded 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.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2024-12254
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 4 Nov 2026, 18:16 UTC · Revision 1
Source evidence
Unbounded memory buffering in SelectorSocketTransport.writelines()
core-osv · Original sourcePublished 6 Dec 2024, 15:19 UTC
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.
osv:CVE-2024-12254
Complete source record
{
"id": "f3de6b26ee4dda13ff8dfcf51b4123bd791d2af07a320cb4369e8f94329ad23a",
"url": "https://osv.dev/vulnerability/CVE-2024-12254",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "Unbounded memory buffering in SelectorSocketTransport.writelines()",
"summary": "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.",
"evidence": "osv:CVE-2024-12254",
"products": [],
"severity": "high",
"structured": {
"id": "CVE-2024-12254",
"aliases": [
"BIT-libpython-2024-12254",
"BIT-python-2024-12254",
"BIT-python-min-2024-12254",
"CVE-2024-12254",
"PSF-2024-14"
],
"metrics": [
{
"type": "CVSS_V4",
"score": "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"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/python/cpython",
"type": "GIT",
"events": [
{
"introduced": "0"
},
{
"fixed": "fdb81425a9ad683f8c24bf5cbedc9b96baf00cd2"
},
{
"introduced": "60403a5409ff2c3f3b07dd2ca91a7a3e096839c7"
},
{
"fixed": "4f8bb3947cfbc20f970ff9d9531e1132a9e95396"
},
{
"introduced": "b092705907c758d4f9742028652c9802f9f03dd3"
},
{
"fixed": "26d485d12255a10a8e965b561e7d8a70a732ec69"
},
{
"fixed": "71e8429ac8e2adc10084ab5ec29a62f4b6671a82"
},
{
"fixed": "9aa0deb2eef2655a1029ba228527b152353135b5"
},
{
"fixed": "e991ac8f2037d78140e417cc9a9486223eb3e786"
}
],
"database_specific": {
"extracted_events": [
{
"range": [
{
"introduced": "0"
},
{
"fixed": "3.12.9"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StandardRange"
},
{
"range": [
{
"introduced": "3.13.0"
},
{
"fixed": "3.13.2"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StandardRange"
},
{
"range": [
{
"introduced": "3.14.0a1"
},
{
"fixed": "3.14.0a3"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StandardRange"
},
{
"range": [
{
"fixed": "71e8429ac8e2adc10084ab5ec29a62f4b6671a82"
}
],
"source": "REFERENCES_COMMIT"
},
{
"range": [
{
"fixed": "9aa0deb2eef2655a1029ba228527b152353135b5"
}
],
"source": "REFERENCES_COMMIT"
},
{
"range": [
{
"fixed": "e991ac8f2037d78140e417cc9a9486223eb3e786"
}
],
"source": "REFERENCES_COMMIT"
}
]
}
}
],
"versions": [
"v3.14.0b2",
"v3.14.0b1",
"v3.13.1",
"v3.12.8",
"v3.14.0a2",
"v3.14.0a1",
"v3.13.0",
"v3.12.7",
"v3.12.6",
"v3.12.5",
"v3.12.4",
"v3.13.0b1",
"v3.13.0a6",
"v3.12.3",
"v3.13.0a5",
"v3.13.0a4",
"v3.12.2",
"v3.13.0a3",
"v3.12.1",
"v3.13.0a2",
"v3.13.0a1",
"v3.12.0",
"v3.12.0rc3",
"v3.12.0rc2",
"v3.12.0rc1",
"v3.12.0b4",
"v3.12.0b3",
"v3.12.0b2",
"v3.12.0b1",
"v3.12.0a7",
"v3.12.0a6",
"v3.12.0a5",
"v3.12.0a4",
"v3.12.0a3",
"v3.12.0a2",
"v3.12.0a1",
"v3.11.0b1",
"v3.11.0a7",
"v3.11.0a6",
"v3.11.0a5",
"v3.11.0a4",
"v3.11.0a3",
"v3.10.0a7",
"v3.10.0a1",
"v3.9.0a2",
"v3.7.0a2",
"v3.6.0b1",
"v3.6.0a3",
"v3.5.0b1",
"v3.5.0a4",
"v3.5.0a3",
"v3.5.0a2",
"v3.5.0a1",
"v3.4.0b3",
"v3.4.0b2",
"v3.4.0b1",
"v3.4.0a4",
"v3.4.0a3",
"v3.4.0a2",
"v3.4.0a1",
"v3.3.0rc3",
"v3.3.0rc2",
"v3.3.0rc1",
"v3.3.0b2",
"v3.3.0b1",
"v3.3.0a4",
"v3.3.0a3",
"v3.3.0a2",
"v3.2rc3",
"v3.2rc2",
"v3.2rc1",
"v3.2b2",
"v3.2b1",
"v3.2a4",
"v3.2a3",
"v3.2a2",
"v3.2a1",
"v3.1",
"v3.1rc2",
"v3.1rc1",
"v3.1b1",
"v3.1a2",
"v3.1a1",
"v3.0rc3",
"v3.0rc2",
"v3.0rc1",
"v3.0b3",
"v3.0b2",
"v3.0b1",
"v3.0a5",
"v3.0a4",
"v3.0a3",
"v3.0a2",
"v3.0a1",
"v2.4",
"v2.4c1",
"v2.4b2",
"v2.4b1",
"v2.4a3",
"v2.4a2",
"v2.4a1",
"v2.3c2",
"v2.3c1",
"v2.2a3",
"v2.1",
"v2.1c2",
"v2.1c1",
"v2.1b2",
"v2.1b1",
"v2.1a2",
"v2.1a1",
"v2.0",
"v2.0c1",
"v2.0b2",
"v2.0b1",
"v1.6a2",
"v1.6a1",
"v1.5.2",
"v1.5.2c1",
"v1.5.2b2",
"v1.5.2b1",
"v1.5.2a2",
"v1.5.2a1",
"v1.5.1",
"v1.5",
"v1.5b2",
"v1.5b1",
"v1.5a4",
"v1.5a3",
"v1.5a2",
"v1.5a1",
"v1.4",
"v1.4b3",
"v1.4b2",
"v1.4b1",
"v1.3",
"v1.3b1",
"v1.2",
"v1.2b4",
"v1.2b3",
"v1.2b2",
"v1.2b1",
"v1.1.1",
"v1.1",
"v1.0.2",
"v1.0.1",
"v0.9.9",
"v0.9.8"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-12254.json"
}
}
],
"modified": "2026-10-28T02:30:38.497249616Z",
"provider": "osv",
"references": [
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/12xxx/CVE-2024-12254.json",
"https://mail.python.org/archives/list/security-announce@python.org/thread/H4O3UBAOAQQXGT4RE3E4XQYR5XLROORB/",
"https://nvd.nist.gov/vuln/detail/CVE-2024-12254",
"https://security.netapp.com/advisory/ntap-20250404-0010/",
"https://github.com/python/cpython/issues/127655",
"https://github.com/python/cpython/commit/71e8429ac8e2adc10084ab5ec29a62f4b6671a82",
"https://github.com/python/cpython/commit/9aa0deb2eef2655a1029ba228527b152353135b5",
"https://github.com/python/cpython/commit/e991ac8f2037d78140e417cc9a9486223eb3e786",
"https://github.com/python/cpython/pull/127656",
"https://github.com/python/cpython"
],
"provider_metadata": {
"cwe_ids": [
"CWE-400",
"CWE-770"
],
"cna_assigner": "PSF",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/12xxx/CVE-2024-12254.json"
}
},
"related_cves": [
{
"value": "CVE-2024-12254",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 505635,
"published_at": "2024-12-06T15:19:41.576+00:00"
}