The vulnerability, CVE-2026-54273, exists in aiohttp's handling of HTTP/1.1 pipelined requests, where a lack of limits on the request queue could lead to a Denial of Service (DoS) attack. An attacker could send a large number of requests on a single connection. If the first request was handled by a slow process, aiohttp would continue to parse and queue all subsequent requests, causing unbounded memory allocation.
The patch addresses this by introducing a backpressure mechanism. A new configuration, MAX_MSG_QUEUE_SIZE, sets a limit on the number of unhandled, pipelined requests.
The key functions modified are:
-
aiohttp.web_protocol.RequestHandler.data_received: This function now monitors the size of the message queue (self._messages). When the queue reaches the MAX_MSG_QUEUE_SIZE limit, it pauses reading from the network transport, preventing further data from being processed and queued.
-
aiohttp.http_parser.HttpParser.feed_data (and its Cython counterpart in _http_parser.pyx): This function, which parses raw data into request objects, was updated to stop parsing when the number of 'in-flight' messages reaches the limit. This acts as a secondary defense to prevent the queue from growing.
-
aiohttp.web_protocol.RequestHandler.start: This function, which consumes requests from the queue, was modified to signal when a request has been processed by calling self._parser.message_consumed(). This signal decrements the in-flight counter. When the queue size drops to a safe level, it triggers the resumption of the network transport, allowing the server to process more incoming requests.
During an exploit, a runtime profile would show RequestHandler.data_received and HttpParser.feed_data being called repeatedly to fill the memory with request objects, while RequestHandler.start would be busy or blocked on a single slow request, allowing the queue to grow unchecked in vulnerable versions.