Aug 3, 2026·7 min read·197 visits
A heap out-of-bounds read in the C-parser of aiohttp allows unauthenticated remote attackers to crash application processes or leak adjacent heap memory by sending specially crafted malformed HTTP requests or responses.
A high-severity heap-based out-of-bounds (OOB) read vulnerability exists in the Cython-based HTTP response and request parser extension of aiohttp. When processing malformed HTTP traffic, the parser fails to properly handle raw C pointers returned by the underlying llhttp library during error-message construction. This triggers an uncontrolled strlen() call on non-null-terminated network buffers, which can result in a Denial of Service (DoS) via worker process crash or the exposure of adjacent heap memory inside exception messages.
The aiohttp framework is a widely deployed asynchronous HTTP client and server library built on Python's asyncio subsystem. To maximize parsing throughput, the project implements a high-performance native C-parser extension in Cython, which wraps the low-level llhttp library. This architecture minimizes the overhead of HTTP message framing, header ingestion, and chunk validation. However, handling execution errors at the boundary between native Python code and raw C memory constructs introduces significant memory safety hazards.
This vulnerability, designated CVE-2026-69244, is a heap-based out-of-bounds (OOB) read that occurs during exception generation. When the llhttp parser encounters syntactically invalid input, the Cython wrapper tries to format a descriptive error message displaying the context of the error. During this process, the parser obtains a raw C pointer pointing to the invalid payload byte and incorrectly treats it as a standard null-terminated C-string.
The attack surface is exposed to any network endpoint that processes untrusted HTTP requests (in server-side configurations) or untrusted HTTP responses (in client-side configurations). The vulnerability is classified under CWE-125 (Out-of-bounds Read), with secondary impacts associated with CWE-416 (Use After Free) and CWE-400 (Uncontrolled Resource Consumption). The vulnerability is completely resolved in version 3.14.3 of the library.
To understand the root cause, it is necessary to examine how llhttp and Cython interact during error handling. When the llhttp state machine detects a protocol violation (such as invalid characters in a chunk size or a missing carriage return), it halts parsing. The Cython wrapper class HttpParser then calls cparser.llhttp_get_error_pos(self._cparser). This C function returns a raw char * pointer indicating the exact memory address in the parsing buffer where the error occurred.
In the vulnerable implementation, the Cython wrapper assigns this raw pointer to the variable after. The code subsequently executes the Python slicing and splitting statement after_b = after.split(b"\r\n", 1)[0]. Because after is a raw C char * and .split() is a Python string method, Cython must implicitly convert the C pointer into a Python bytes object before executing the method. Because Cython is not given an explicit length for the buffer at the C-pointer address, it assumes the pointer references a standard, null-terminated C-string.
To perform this implicit conversion, Cython invokes the native C-library function strlen() on the pointer. However, network buffers received from sockets are not null-terminated; they contain raw bytes representing TCP stream segments. If a parsing error occurs exactly at the end of the incoming buffer chunk, strlen() will fail to find a null byte (\x00) within the boundaries of the allocated buffer. The function then continues reading sequentially through adjacent heap memory blocks until it eventually hits a null byte. This behavior leads directly to a heap-based out-of-bounds read.
The following code block highlights the exact flaw in the Cython-based HTTP parser (aiohttp/_http_parser.pyx) and contrasts the vulnerable logic with the official patch.
# === VULNERABLE CODE (aiohttp < 3.14.3) ===
# The parser retrieves the raw C error position pointer.
# Cython implicitly casts the raw char* pointer to a Python bytes object
# using strlen() because no buffer length is specified.
after = cparser.llhttp_get_error_pos(self._cparser)
before = data[:after - base]
# The split method forces an un-bounded strlen call on a non-null-terminated heap buffer.
after_b = after.split(b"\r\n", 1)[0]
# === PATCHED CODE (aiohttp 3.14.3) ===
# The patch computes the safe integer offset relative to the base pointer.
error_pos = cparser.llhttp_get_error_pos(self._cparser)
error_off = error_pos - base
# Slicing is performed strictly on the native Python 'data' bytes object.
before = data[:error_off]
after = data[error_off:].split(b"\r\n", 1)[0]The patched version replaces pointer-based manipulation with integer offset calculations. Rather than converting the raw pointer after directly to a Python object, the code calculates error_off = error_pos - base. Since base is the starting address of the known buffer and error_pos is the error address within that buffer, error_off is a safe, relative integer offset.
Slicing is then performed directly on data, which is already a native Python bytes object representing the buffer. Slicing in Python is strictly bounds-checked by the interpreter. If error_off points to the end of the buffer, Python safely handles the slice without reading beyond the underlying memory allocation. This approach completely prevents unsafe native-level pointer parsing and eliminates the vulnerability.
Exploitation of CVE-2026-69244 does not require authentication and can be executed via either server-side or client-side vectors. In a server-side attack vector, the target is an aiohttp-based web server. The attacker crafts a malicious HTTP request designed to trigger a protocol syntax error precisely at the termination boundary of the request payload. For example, the attacker can transmit a request utilizing chunked transfer encoding where the chunk specification ends abruptly as 0_ or 0\rX without a trailing carriage return line feed (CRLF).
When the server receives this payload, the socket buffer terminates immediately after the malformed character. The llhttp engine flags the error, and the exception handler is executed. Because the buffer lacks a trailing null terminator, the strlen() call traverses the heap, attempting to locate a null byte. The physical flow of this exploitation sequence is illustrated below:
The vulnerability behaves in two ways depending on the heap layout. If the strlen() scan crosses page boundaries into unmapped virtual memory, the operating system kernel immediately kills the python worker process with a segmentation fault (SIGSEGV). This results in an immediate Denial of Service. Alternatively, if the scan resolves within mapped memory, the adjacent heap bytes are converted into the python exception object and can be leaked to logs or directly to the attacker in HTTP error responses.
The primary threat posed by this vulnerability is a remote, unauthenticated Denial of Service (DoS). For applications running aiohttp as a web server, sending a steady stream of malformed requests can repeatedly crash active worker processes. This forces container engines or service managers to repeatedly restart the process, exhausting system resources and causing a sustained outage for legitimate users.
The CVSS v4.0 base score is rated at 7.1 with the vector CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N. This calculation highlights that the vulnerability is remotely exploitable with low complexity, requires no special system configurations, and demands no administrative privileges. Although the CVSS evaluation conservatively rates confidentiality impact as None, real-world exploitation in multi-tenant environments introduces a localized risk of informational leakage.
Because the out-of-bounds heap data is formatted into a Python exception object, any application configured to return verbose error tracebacks to clients may leak adjacent heap memory. This leaked memory can contain sensitive objects, such as session cookies, database connection strings, or encryption keys from other active connection threads. This behavior elevates the actual risk beyond a simple process crash.
The recommended remediation is to upgrade all installations of aiohttp to version 3.14.3 or later. This replaces the vulnerable Cython pointer manipulation logic with the safe, offset-based slicing mechanism. Package managers can execute the following command to update the dependency:
pip install -U aiohttp>=3.14.3
If upgrading is not immediately feasible due to legacy system constraints, administrators can fully mitigate the vulnerability by disabling the compiled Cython extensions. This forces aiohttp to fall back on its pure-Python HTTP parser, which is inherently safe from native-level memory bounds issues. To implement this workaround, set the following environment variable in the application's runtime environment:
export AIOHTTP_NO_EXTENSIONS=1
Note that disabling C extensions will decrease HTTP parsing performance and increase CPU utilization under high-traffic conditions. Consequently, this workaround should only be used as a temporary measure until the library can be updated. Organizations should also monitor deployment environments for container crashes returning exit code 139 (SIGSEGV) to identify potential exploitation attempts.
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N| Product | Affected Versions | Fixed Version |
|---|---|---|
aiohttp aio-libs | < 3.14.3 | 3.14.3 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-125 |
| Attack Vector | Network |
| CVSS v4.0 Score | 7.1 |
| EPSS Score | Not Available |
| Vulnerability Class | Heap Out-of-Bounds Read |
| Exploit Status | Proof-of-Concept (PoC) |
| CISA KEV Status | Not Listed |
The program reads data past the end, or before the beginning, of the intended buffer.
CVE-2026-55622 (GHSA-qx75-2p3r-pwm5) is an improper access control vulnerability (CWE-284) in Canonical LXD and LXC Incus (tracked as GHSA-c9f5-j9c3-mhrg). In multi-tenant deployments utilizing project-based isolation, the REST API handler for instance creation via POST /1.0/instances verifies that the authenticated user has authorization in the destination project specified by the query parameter, but fails to verify whether the user holds read or view permissions for the source instance when executing a copy operation across projects. Consequently, an authenticated client restricted to a single project can clone instances or snapshots from unauthorized projects into their own project, resulting in complete disclosure of the target instance filesystem and embedded credentials.
An authorization bypass vulnerability in Canonical LXD (tracked as GHSA-7mr3-28h5-m5vx and CVE-2026-55621, and as GHSA-64f3-v33m-w89f in Linux Containers Incus) allows an authenticated user with restricted project access to copy custom storage volumes and volume snapshots from unauthorized projects. The flaw resides in the storagePoolVolumesPost REST API handler, which verifies permissions on the destination project but fails to check whether the caller holds view entitlements on the source project or volume specified in the request body.
A missing authorization and configuration validation vulnerability in Canonical LXD and LXC Incus allows authenticated users within restricted projects to bypass project security boundaries. By smuggling prohibited low-level configuration directives (such as raw.lxc or raw.qemu) inside instance snapshots or backup archives, an attacker can restore these configurations within a restricted project and execute arbitrary commands with root privileges on the underlying host operating system.
A symbolic link traversal vulnerability (CWE-59) in Canonical LXD and Linux Containers Incus allows an authenticated user with image import permissions to read and write arbitrary files on the host filesystem. During image archive unpacking, the daemon fails to reject top-level symbolic links for the instance `templates` directory. Subsequent requests to the instance template API endpoints follow this symbolic link outside the instance storage directory with root privileges, enabling complete host compromise.
CVE-2026-12411 is a broken access control vulnerability in the DevLXD interface of Canonical LXD versions 6.6 through 6.8. The flaw resides in the devLXDInstancePatchHandler component, which fails to verify storage volume ownership when an instance attaches a new disk device via the /dev/lxd guest socket. When the security.devlxd.management.volumes configuration option is enabled, an untrusted guest or DevLXD identity can issue a crafted HTTP PATCH request referencing another tenant's custom storage volume. The LXD host daemon subsequently mounts the target volume into the requesting guest, permitting unauthorized cross-tenant read and write operations.
CVE-2026-105769 (GHSA-5q7h-w9jf-cx97, GO-2026-6225) is an origin validation error and credential exfiltration vulnerability affecting Kaniko prior to version 1.25.20. The flaw stems from an unanchored regular expression in the integrated Azure Container Registry (ACR) credential helper (github.com/chrismellard/docker-credential-acr-env). When Kaniko processes a Dockerfile containing an image reference hosted on a lookalike domain containing an ACR suffix as a substring (e.g., x.azurecr.io.attacker.com), the credential helper acquires a Microsoft Entra ID access token for Azure Resource Manager and transmits it via HTTP POST to the attacker-controlled host.