Executive brief
A security vulnerability has been identified in Python's 'asyncio' library specifically affecting Windows systems. The flaw exists in a networking component used to receive data into a pre-allocated buffer; if an attacker sends more data than the buffer can hold, it can cause the application to crash or potentially allow for unauthorized memory modification. This could impact the reliability and security of Windows-based Python applications that handle network communications.
Technical details
An out-of-bounds (OOB) write vulnerability (CWE-787) exists in CPython's 'asyncio' module on Windows platforms. The vulnerability is located in the 'sock_recvfrom_into()' method of the 'ProacterEventLoop' class. When the 'nbytes' parameter is utilized, the implementation fails to validate that the incoming data size does not exceed the provided buffer's capacity. A remote attacker can exploit this by sending a network packet larger than the expected buffer size, resulting in a heap-based buffer overflow. This can lead to application crashes (denial of service) or potentially arbitrary code execution. The issue is specific to the Windows 'overlapped' I/O implementation and does not affect Unix-like platforms. Patches have been merged into CPython versions 3.13, 3.14, and 3.15.
Affected products
- Python Software Foundation CPython < 3.13.14, 3.14.0a1 < 3.14.5rc1, 3.15.0a1 < 3.15.0b1
Timeline
- 2026-04-20: disclosed: Issue reported and PR opened on GitHub
- 2026-04-21: patched: Fix merged into CPython main branch
- 2026-04-21: advisory: Official security announcement sent to python-announce list
References
- https://github.com/python/cpython/commit/1274766d3c29007ab77245a72abbf8dce2a9db4d
- https://github.com/python/cpython/commit/27522b7d6e6588f03e61099dd858cd5a9314e2f2
- https://github.com/python/cpython/commit/95633d2aad4721e25e4dfd9f43dfb6e1edcbd741
- https://github.com/python/cpython/issues/148808
- https://github.com/python/cpython/pull/148809
- https://mail.python.org/archives/list/security-announce@python.org/thread/KWTPIQBOOOUNQP7UFSLBI437NJDFLA3F/