Rust zstd Dictionary-Training Flaws Allow Out-of-Bounds Reads
Vulnerability Disclosure · 3 sources · Updated 22d ago · First seen Oct 26, 2026

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.


