rust-zserio, Unbounded Memory Allocation, GHSA-FPF5-4JW8-67X8 (High)

Listen to this Post

How the CVE Works

The vulnerability lies in how zserio-based deserialization routines handle variable-length structures. When the runtime processes an array, string, or binary blob, it first reads a header that specifies the total length of the upcoming data. This length is taken directly from the input stream and is trusted without any validation. The runtime then immediately uses that value to allocate a memory buffer of the specified size.
An attacker can craft a malicious Zserio payload that contains a tiny legitimate header (as small as 4–5 bytes) but declares an enormous length − for example, 2,147,483,647 (the maximum 32‑bit signed integer). Because the size is not checked, the `rust-zserio` runtime will attempt to allocate a memory region of that claimed size − up to 16 GB on a 64‑bit system.
On a typical host with limited physical memory, such an allocation triggers an out‑of‑memory (OOM) condition, causing the entire process to crash. This results in a denial of service (DoS). The attack requires no authentication, can be launched remotely via a network‑delivered payload, and is trivial to exploit.
The issue affects all versions of `rust-zserio` up to and including v0.5.3. The fix, introduced in commit 57f5fb, replaces the blind `Vec::with_capacity()` call with a push‑based loop that allocates memory incrementally, thereby preventing a single oversized request from exhausting the system’s memory.

📋 DailyCVE Form

Platform: rust-zserio
Version: <=0.5.3
Vulnerability: Unbounded Memory
Severity: High
Date: 2026-05-01

Prediction: Patch 2026-05-07

📊 Analytics – What Undercode Say

Check installed rust-zserio version

cargo tree | grep rust-zserio

Reproduce the vulnerability (create a 5‑byte malicious payload)

printf '\xff\xff\xff\x7f\x00' > malicious.zserio

Run the vulnerable parser (PoC)

cargo run -- --input malicious.zserio

Apply the fix (update dependency)

cargo update -p rust-zserio --precise 0.5.4

Rust code snippet – vulnerable allocation (pre‑patch)

let size = reader.read_varsize(); // attacker-controlled
let mut buf = Vec::with_capacity(size); // OOM if size huge
reader.read_bytes(&mut buf);

Rust code snippet – patched allocation (post‑patch)

let size = reader.read_varsize();
let mut buf = Vec::new();
buf.reserve(size.min(MAX_CHUNK)); // bounded allocation
while buf.len() < size {
let chunk = reader.read_bytes(CHUNK_SIZE);
buf.extend_from_slice(&chunk);
}

🔓 Exploit

A remote, unauthenticated attacker sends a single Zserio message containing a `varsize` field set to a large value such as 2,147,483,647. Because the length is not checked, the receiving application attempts to allocate a memory buffer of that size, leading to an immediate OOM crash (DoS). No additional data is required; the entire attack fits into 4–5 bytes of payload.

🛡️ Protection from this CVE

  1. Update `rust-zserio` to v0.5.4 (or cherry‑pick commit 57f5fb).
  2. Regenerate all Rust code derived from Zserio schemas after the update.
  3. Do not accept Zserio‑encoded messages from untrusted sources.
  4. Set a heap usage limit for the process (e.g., `ulimit -v 1048576` on Linux) to kill the process before it exhausts system memory.
  5. Deploy a network WAF that rejects unusually large Zserio length fields before they reach the application.

💥 Impact

  • Denial of Service (DoS) – The vulnerable process crashes immediately upon receiving a crafted payload.
  • Low attack complexity – A successful attack requires only a few bytes of input and no special privileges.
  • Widespread exposure – Any system that deserializes untrusted Zserio data using an affected `rust-zserio` version is at risk.
  • Potential for collateral damage – If the crashed process is part of a larger system (e.g., an automotive ECU or a cloud map‑update pipeline), the DoS can cascade, affecting dependent services.

🎯Let’s Practice Exploiting & Learn Patching For Free:

Sources:

Reported By: github.com
Extra Source Hub:
Undercode

🔐JOIN OUR CYBER WORLD [ CVE News • HackMonitor • UndercodeNews ]

💬 Whatsapp | 💬 Telegram

📢 Follow DailyCVE & Stay Tuned:

𝕏 formerly Twitter 🐦 | @ Threads | 🔗 Linkedin Featured Image

Scroll to Top