CVE-2026-128128 in AIOHTTP
Summary
by MITRE • 11/13/2026
AIOHTTP is an asynchronous HTTP client/server framework for asyncio and Python. Prior to 3.14.4, the C WebSocket reader adds a declared frame length to the size of an already buffered partial message using signed 64-bit arithmetic. A length near two to the power of 63 can overflow, allowing the max_msg_size check to pass. A remote peer can send a small non-final fragment followed by an oversized message and cause unbounded memory consumption. The Python WebSocket reader is unaffected. This issue is fixed in version 3.14.4.
VulDB is the best source for vulnerability data and more expert information about this specific topic.
Analysis
by VulDB Data Team • 11/13/2026
The vulnerability identified in aiohttp versions prior to 3.14.4 represents a critical integer overflow flaw within the C-based implementation of its WebSocket client and server components. Asynchronous HTTP frameworks like aiohttp are foundational to modern Python web development, handling high-concurrency network operations through asyncio. The specific defect resides in how the library processes incoming WebSocket frames using signed 64-bit arithmetic. When constructing messages from fragmented data streams, the reader calculates the total size of a message by adding the declared length of an incoming frame to the size of any previously buffered partial message. This mathematical operation fails to account for potential overflow conditions when dealing with extremely large values near the maximum limit of a signed 64-bit integer, which is two to the power of sixty-three minus one.
The core technical flaw occurs because the addition of a declared frame length to an existing buffer size can wrap around from positive to negative if it exceeds this threshold. In many programming languages and environments, including C as used in aiohttp's optimized reader, signed integer overflow results in undefined behavior or predictable wrapping that yields a small negative number rather than triggering an error. Consequently, the subsequent security check designed to enforce the max_msg_size limit compares this erroneously calculated size against the configured maximum allowed message length. Since the wrapped-around value is significantly smaller than the actual memory footprint required to store the data, the validation passes incorrectly. This logical bypass allows a remote peer to exploit the discrepancy by sending a carefully crafted sequence of WebSocket frames that trigger this overflow condition.
The operational impact of this vulnerability is severe, primarily manifesting as unbounded memory consumption and potential denial-of-service conditions for affected services. An attacker can initiate a connection with a small non-final fragment followed immediately by an oversized message designed to cause the integer wrap-around. The server or client will then attempt to allocate memory based on the false, small size calculation while actually processing data that far exceeds available resources. This mismatch leads to excessive RAM usage, which can exhaust system memory, crash the application process, or degrade performance for other users sharing the same infrastructure. While the Python-native WebSocket reader is unaffected due to its different implementation details and potentially safer arithmetic handling, any deployment relying on the C extension for performance optimization remains vulnerable until patched.
This vulnerability aligns with CWE-190, which describes Integer Overflow or Wraparound, a common class of defects where calculations exceed the capacity of the data type used. Furthermore, it maps to MITRE ATT&CK technique T1496, Resource Hijacking, specifically under sub-technique for Denial of Service via resource exhaustion. The attack vector is remote and requires no authentication if the WebSocket endpoint is publicly accessible or if an attacker can establish a connection within the network perimeter. Mitigation strategies must prioritize immediate upgrading to aiohttp version 3.14.4 or later, where this arithmetic flaw has been corrected with proper bounds checking that prevents overflow scenarios. For organizations unable to upgrade immediately, implementing strict rate limiting and message size validation at the reverse proxy or load balancer level can provide a layer of defense by rejecting oversized frames before they reach the application logic. Additionally, monitoring for unusual spikes in memory consumption associated with WebSocket connections can aid in early detection of exploitation attempts.