Skip to main content
Mallory
← Back to News
open-source-dependency-vulnerability

Rust zstd Streaming Decoder Flaws Can Expose Up to 32 KiB of Heap Memory

Vulnerability Disclosure · 3 sources · Updated 22d ago · First seen Oct 26, 2026

Rust zstd Streaming Decoder Flaws Can Expose Up to 32 KiB of Heap Memory

RustSec disclosed related memory-exposure vulnerabilities in the Rust zstd and zstd-safe crates that can expose stale heap data when streaming decompression encounters corrupt legacy Zstandard frames. RUSTSEC-2026-0392 affects zstd versions 0.4.22 through 0.7.x, while RUSTSEC-2026-0403 affects zstd-safe versions from 4.0.0 up to, but excluding, 8.2.0. Through the streaming write decoder, a malformed legacy frame as small as five or six bytes can cause up to 32 KiB of uninitialized heap memory to reach the application's wrapped writer. Legacy support is enabled by default; disclosure to an attacker depends on where the application sends that output.

The flaws stem from incorrect output-buffer length or position handling after decompression fails, potentially extending a Rust vector over memory that was never initialized. The zstd-safe patch restores previous buffer positions on error, with a regression test confirming that failed decompression leaves buffer positions and output length at zero. zstd-safe 8.2.0 fixes the flaw; moving to zstd 0.8.0 alone is insufficient because that release switched to the separately affected zstd-safe buffers. Organizations processing untrusted compressed data should review streaming write-decoder usage and dependency lockfiles and ensure the patched dependency is deployed. The read decoder, zstd::decode_all, and bulk API are unaffected by the zstd-safe advisory.

Do you run this?See affected versions and whether adversaries are exploiting it.
Check your exposure
Event timeline

How this story unfolded

Events from the most recent confirmed update back to the earliest known activity.

4 events · Oct 16, 2026 – Oct 26, 2026
  1. Reported Oct 26, 202623d ago

    zstd-safe 8.2.0 fixes legacy-frame memory exposure

    The flaw affecting zstd-safe versions 4.0.0 through versions before 8.2.0 was fixed in version 8.2.0. The fix commits buffer positions only after successful calls.

    RUSTSEC-2026-0403: zstd-safe: Uninitialized memory exposed when streaming decompression of a legacy frame fails › RustSec Advisory Database
  2. Oct 26, 202623d ago

    RustSec issues advisories for zstd and zstd-safe memory exposure

    RustSec issued RUSTSEC-2026-0392 for zstd versions 0.4.22 through 0.7.x and RUSTSEC-2026-0403 for zstd-safe versions 4.0.0 through versions before 8.2.0. The advisories describe corrupt legacy frames causing up to 32 KiB of stale heap memory to reach a wrapped writer; attacker access depends on where the application sends that output.

    RUSTSEC-2026-0403: zstd-safe: Uninitialized memory exposed when streaming decompression of a legacy frame fails › RustSec Advisory Database
  3. Reported Oct 16, 20261mo ago

    zstd-safe patch prevents buffer-position propagation after streaming errors

    Commit 006e1d1 adds checks that restore previous input and output positions when streaming operations fail, preventing vector lengths from covering uninitialized capacity. A regression test verifies that malformed legacy-frame decompression leaves buffer positions and output vector length at zero.

    zstd-safe: only commit buffer positions from successful streaming calls · gyscos/zstd-rs@006e1d1 · GitHub
  4. Oct 16, 20261mo ago

    Memory-exposure vulnerabilities reported in zstd and zstd-safe

    Vulnerabilities in zstd's older streaming writer and zstd-safe were reported. Processing corrupt legacy Zstandard frames could cause incorrect output-buffer lengths to expose uninitialized heap memory.

    RUSTSEC-2026-0403: zstd-safe: Uninitialized memory exposed when streaming decompression of a legacy frame fails › RustSec Advisory Database
Do you run this?See whether adversaries are exploiting this yet, and where the affected versions run in your environment.
Check Your Exposure
Mallory platform

See the full picture, correlated to your attack surface.

This page covers what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which threat actors are using it right now, and what to deploy next.

Exposure mappingMap indicators from this story to your assets and identify affected systems in minutes.
Threat actor evidenceEvery observed campaign, victim, and pivot linked to actors named in this story.
Associated malwareMalware, exploits, and IOCs connected to the activity described here.
Detection signaturesYARA, Sigma, and Snort rules deployed to your SIEM as soon as they’re published.
Scheduled alertsGet matching new stories delivered to your team as they break, not the next morning.
AI threadsAsk questions about this story and take action on the answers.