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

Rust zstd Dictionary-Training Flaws Allow Out-of-Bounds Reads

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

Rust zstd Dictionary-Training Flaws Allow Out-of-Bounds Reads

RustSec disclosed related out-of-bounds read vulnerabilities in the Rust zstd and zstd-safe crates that affect dictionary training with untrusted sample sizes. RUSTSEC-2026-0393 covers an unsound zstd interface whose older implementations either lacked sample-size validation or used an unchecked sum. RUSTSEC-2026-0401 affects zstd-safe versions before 8.2.0: when overflow checks are disabled, as in typical release builds, sample-size totals can wrap around and incorrectly pass buffer-length validation, allowing reads beyond the supplied samples buffer. Since zstd 0.4.10, its dictionary-training interface has delegated validation to zstd-safe and is therefore also affected by the dependency flaw.

The fix uses checked addition to reject overflowing sample-size totals, with commit 781ea45 adding regression tests for both affected functions. Organizations using these crates for dictionary training should update zstd-safe to 8.2.0 or later, verify that dependent zstd deployments resolve to the patched dependency, and review whether untrusted sources can control sample sizes. Both advisories were reported on October 16 and published on October 26, 2026; the supplied references do not report exploitation in the wild.

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 the dictionary-training overflow flaw

    Version 8.2.0 corrected zstd-safe's sample-size validation by checking for overflow. The fix also addresses the delegated training path used by zstd::dict::from_continuous since zstd 0.4.10.

    RUSTSEC-2026-0393: zstd: Out-of-bounds read when training a dictionary from inconsistent sample sizes › RustSec Advisory Database
  2. Oct 26, 202623d ago

    RustSec issues linked advisories for zstd and zstd-safe

    RustSec issued RUSTSEC-2026-0393 for zstd's earlier dictionary-training implementation and RUSTSEC-2026-0401 for zstd-safe's overflowing sample-size validation. The advisories identify potential memory exposure through out-of-bounds reads when sample sizes originate from an untrusted source.

    RUSTSEC-2026-0393: zstd: Out-of-bounds read when training a dictionary from inconsistent sample sizes › RustSec Advisory Database
  3. Reported Oct 16, 20261mo ago

    Patch adds overflow detection to dictionary sample-size validation

    Commit 781ea454191dbf178d09c1daf6fc896d15fbaa2f replaced unchecked sample-size summation with checked addition in zstd::dict::from_continuous and zstd_safe::train_from_buffer. It also added regression tests verifying that overflowing sample sizes are rejected.

    Check dictionary sample sizes with overflow detection · gyscos/zstd-rs@781ea45 · GitHub
  4. Oct 16, 20261mo ago

    Dictionary-training vulnerabilities reported in zstd and zstd-safe

    Unsound dictionary-training interfaces in zstd and zstd-safe were reported. Untrusted sample sizes could bypass buffer-length validation, including through integer overflow, and cause out-of-bounds reads.

    RUSTSEC-2026-0393: zstd: Out-of-bounds read when training a dictionary from inconsistent sample sizes › 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.