May 7, 2026·7 min read·44 visits
Unbounded memory allocation in rust-zserio allows remote attackers to trigger an Out-of-Memory crash by providing malformed bitstreams with massive array lengths.
A critical vulnerability exists in the rust-zserio crate regarding how auto-generated deserialization routines handle variable-length structures. By supplying a maliciously crafted Zserio bitstream with an artificially inflated size header, an attacker can force the application to request massive memory allocations, resulting in an Out-of-Memory (OOM) panic and process termination.
The rust-zserio crate provides native Rust bindings and code generation capabilities for the Zserio serialization protocol. Zserio is designed for memory-efficient and schema-driven data encoding, frequently employed in embedded systems and network communications. The generated decoders handle bit-level parsing of serialized structures based on predefined schemas.
A critical vulnerability, tracked as GHSA-FPF5-4JW8-67X8, exists in the auto-generated deserialization routines of the rust-zserio crate. The flaw is classified as CWE-770: Allocation of Resources Without Limits or Throttling. It manifests during the decoding of variable-length arrays, strings, and byte sequences from untrusted bitstreams.
The underlying issue stems from a structural misalignment between the declarative length of incoming data and the actual bytes present in the payload. The vulnerable decoders implicitly trust the length headers embedded within the serialized data. Consequently, the application attempts an immediate, upfront memory allocation equal to the declared length before validating the remainder of the bitstream.
The root cause of this vulnerability lies in the implementation of array and sequence instantiation within the generated Rust decoder code. Specifically, the crates/zserio-rs-build/src/internal/generator/decode.rs component dictates how the decoder processes variable-length fields. When encountering an array, the decoder first reads the varsize integer prefix.
The varsize header dictates the number of elements contained in the subsequent data stream. In the vulnerable implementation, the decoder utilizes the vec![initial_value; array_length] macro to initialize the entire sequence simultaneously. This macro triggers the Rust memory allocator to request a continuous block of heap memory capable of holding the specified number of elements.
Because the varsize value is read directly from the untrusted network payload, an attacker maintains complete control over the array_length parameter. The decoder performs no bounds checking against the physical size of the remaining bitstream or the available system memory. If the requested allocation size exceeds the available heap space, the Rust runtime triggers an unrecoverable panic, resulting in immediate process termination.
This behavior violates the principle of incremental resource allocation during untrusted data parsing. By treating the unverified length prefix as an authoritative allocation directive, the system creates a direct pathway for resource exhaustion. The vulnerability requires only a few bytes of malicious input to force gigabytes of memory allocation requests.
An examination of the codebase reveals the mechanical nature of the vulnerability. In versions prior to the patch, the code generator emitted deserialization logic that performed bulk memory initialization. The unpatched code path explicitly requested full allocation via the vec! macro based purely on the parsed header size.
// Vulnerable implementation in generated decode.rs
function.line(format!(
"{} = vec![initial_value; {}_array_length];",
rvalue_field_name, field_details.field_name,
));This single line of generated code forces the Rust standard library to attempt a massive contiguous heap allocation. If array_length is crafted to be 0x7FFFFFFF (the maximum value for a 32-bit signed integer) and the element size is 4 bytes, the process immediately requests 8 gigabytes of memory.
The patch implemented in commit 57f5fb4a2a8611d58dbcc1a9221349206dd99c3c mitigates this issue by fundamentally altering the allocation strategy. The updated generator now employs a chunked reservation system and an incremental growth model. The system limits the initial capacity reservation to a configurable threshold, defined by zserio::get_array_alloc_chunk().
// Patched implementation utilizing chunked reservation
data.reserve(array_length.min(ARRAY_ALLOC_CHUNK.load(Ordering::Relaxed)));
// ... followed by a push-based loop that validates available stream data
for _ in 0..array_length {
data.push(read_element(reader)?);
}By utilizing data.push() within a loop, the decoder reads and instantiates elements one by one. If the bitstream terminates prematurely, the read_element function returns an error, safely aborting the decoding process before any dangerous memory growth occurs. Similar bounds checking was implemented for read_string and read_bytes.
Exploitation of GHSA-FPF5-4JW8-67X8 is straightforward and requires minimal bandwidth. The attacker must possess the ability to deliver a serialized Zserio payload to an endpoint utilizing the vulnerable generated code. No authentication or complex state manipulation is necessary to trigger the condition.
The exploit methodology begins with the construction of a malformed Zserio object. The attacker crafts a payload where a target array, string, or byte blob field begins with a mathematically maximized varsize header. The integer representation is manipulated to indicate a sequence length that guarantees a fatal memory allocation failure.
Immediately following the manipulated header, the attacker truncates the payload or provides minimal arbitrary data. The total size of the transmitted exploit packet is typically less than twenty bytes. The efficiency of this attack vector makes it highly effective for distributed denial-of-service (DDoS) campaigns, as the cost to the attacker is negligible.
Upon reception, the target application enters the deserialization routine. It extracts the inflated length parameter and issues the memory allocation request. The operating system denies the excessive allocation, the Rust runtime panics due to the Out-of-Memory condition, and the hosting process crashes unconditionally.
The primary impact of this vulnerability is a complete Denial of Service (DoS). When the target application encounters the malformed input, the resulting memory exhaustion crash immediately terminates the process. All concurrent operations, active connections, and internal states managed by the process are destroyed.
For systems deploying rust-zserio in network-facing roles, such as telemetry aggregators or IPC message brokers, this vulnerability poses a severe reliability threat. Continuous transmission of the exploit payload will trap the service in a perpetual crash-loop. High availability architectures will struggle to maintain uptime, as instances are terminated as rapidly as they can be restarted.
The vulnerability exhibits a highly asymmetric resource cost. The computational and bandwidth requirements for the attacker are virtually zero, while the operational cost to the defender is complete service disruption. This dynamic is characteristic of CWE-770 and underscores the necessity of strict resource boundaries when processing untrusted input.
The diagram models the failure path. Regardless of whether the operating system strictly denies the allocation or attempts to swap memory, the outcome is detrimental to the host system.
The definitive remediation for GHSA-FPF5-4JW8-67X8 is upgrading the rust-zserio dependency to the latest version encompassing commit 57f5fb4a2a8611d58dbcc1a9221349206dd99c3c. Following the dependency update, developers must regenerate all Zserio deserialization code to apply the patched allocation logic.
The patched version introduces configurable chunk allocation limits to balance performance and safety. Developers can tune the initial memory allocation threshold utilizing the zserio::set_array_alloc_chunk(n: usize) function. The default value of 1,000 elements provides a sensible baseline, preventing bulk allocation while maintaining efficient parsing for legitimate structures.
If immediate deployment of the patched library is not feasible, mitigation options are limited. Network-level controls, such as Web Application Firewalls (WAFs), cannot reliably inspect binary Zserio bitstreams due to the lack of clear-text signatures and the complex nature of the schema definitions. Therefore, remediation must occur at the application layer.
Organizations utilizing rust-zserio should audit their network exposure and restrict access to deserialization endpoints. Implementing strict mutual TLS (mTLS) authentication or network segmentation can drastically reduce the attack surface, limiting exploitation capabilities to trusted internal entities until the patch is fully integrated.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
rust-zserio Danaozhong | < 57f5fb4a2a8611d58dbcc1a9221349206dd99c3c | 57f5fb4a2a8611d58dbcc1a9221349206dd99c3c |
| Attribute | Detail |
|---|---|
| CWE | CWE-770 |
| Attack Vector | Network (Malicious Payload) |
| Impact | Denial of Service (DoS) |
| Exploit Status | Proof of Concept (PoC) Available |
| Authentication Required | None |
| Remediation | Code Generator Update |
The software allocates memory or other resources based on an untrusted size value, without enforcing a safe upper limit.
CVE-2026-114155 is a local elevation of privilege vulnerability affecting Microsoft .NET on Linux and macOS platforms. The vulnerability exists within the dotnet-watch (Hot Reload) component and is caused by a Time-of-Check Time-of-Use (TOCTOU) race condition (CWE-367) during the generation and execution of temporary XML solution files (.slnx) in shared system temporary directories. A local attacker with low privileges can intercept and modify the temporary solution file before MSBuild evaluates it, achieving arbitrary code execution in the security context of the user running dotnet-watch.
CVE-2026-118748 is a remote Denial of Service (DoS) vulnerability in Microsoft ASP.NET Core (.NET 11.0 preview releases prior to 11.0.0) and Microsoft Visual Studio 2026 (prior to 18.12.0). The flaw originates from unbounded resource allocation (CWE-770) within the Blazor static server-side rendering (static-SSR) validation pipeline, where dynamic or attacker-supplied form field identifiers are cached in a singleton-scoped memory structure without size limits or eviction policies. Unauthenticated remote attackers can exploit this condition over the network by sending repeated HTTP requests with unique field names, exhausting heap memory and terminating the host process via an unhandled OutOfMemoryException.
CVE-2026-114150 is a network-accessible information disclosure vulnerability affecting Microsoft ASP.NET Core in .NET 11.0 preview releases and Microsoft Visual Studio 2026 prior to version 18.12.0. The flaw stems from the use of uninitialized resources (CWE-908) within response buffering components, specifically ResponseBufferingStream used by middleware such as HTTP Logging and Output Caching. Because rented memory segments from ArrayPool<byte> or MemoryPool<byte> are not cleared upon return or strictly bounded to the exact written byte count during subsequent reads, residual response payloads from earlier HTTP requests remain in the buffer tail. Downstream consumers or log sinks reading these buffers expose confidential cross-session data, including authentication tokens and personally identifiable information.
An incorrect authorization vulnerability (CWE-863) exists in the ASP.NET Core SignalR HTTP Connection Dispatcher (`Microsoft.AspNetCore.Http.Connections`). The connection negotiation process failed to bind the authenticated caller identity to the generated connection state, and subsequent transport or message dispatch handlers failed to verify caller consistency. Consequently, an authenticated low-privilege attacker who obtains a valid connection identifier or token can inject messages into or hijack another user's SignalR session, achieving an elevation of privilege across security boundaries.
CVE-2026-109478 is a network-accessible Denial of Service (DoS) vulnerability in ASP.NET Core caused by inefficient algorithmic complexity (CWE-407) when parsing comma-separated HTTP request headers. Prior to the patch, the internal helper method ParsingHelpers.GetHeaderSplit repeatedly called StringValues.Concat inside a loop iterating over each comma-separated token. Because StringValues allocates a new array of size k + 1 and copies all existing elements upon each concatenation, processing N tokens incurs O(N^2) time and space complexity. An unauthenticated remote attacker can send HTTP requests with headers containing thousands of short, comma-separated values to exhaust CPU cycles and induce severe Garbage Collection (GC) pauses, rendering the web application unresponsive.
CVE-2026-114147 is a high-severity Denial of Service (DoS) vulnerability affecting ASP.NET Core and specifically the Microsoft.AspNetCore.SignalR.StackExchangeRedis scale-out provider across .NET 8.0, 9.0, 10.0, and 11.0 preview releases. The vulnerability originates from a string comparison mismatch between internal per-connection group collections and the centralized Redis channel subscription registry, compounded by a race condition during connection teardown. Remote unauthenticated attackers can exploit this flaw to leave orphaned connection contexts and active Redis pub/sub listeners pinned in memory, leading to unbounded memory exhaustion and application process termination.