zstd-safe out-of-bounds read in seekable stream compression

Severity: info · Published 2026-10-16

zstd-safe is a Rust library for compression using the ZSTD algorithm. An out-of-bounds read vulnerability allows an attacker to read memory past the end of an input buffer during compression, potentially exposing sensitive data or causing a crash. The vulnerable function accepts an unchecked position parameter that the underlying C library does not validate properly.

Technologies: zstd-safe (crates.io). Vendors: crates.io.

Quick answers

Is This vulnerability exploited in the wild?
No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.
How severe is This vulnerability?
Informational severity, published 16 October 2026.
Which products and versions are affected?
zstd-safe (crates.io) SEMVER:introduced=7.2.2,fixed=8.2.0; Zstd-Rs Project Zstd-Safe 7.2.2 to before 8.2.0.
Is there a fix for This vulnerability?
Yes. zstd-safe (crates.io): upgrade to 8.2.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is This vulnerability attacked?
It is attacked with local access, in a software library.
Am I affected?
Check whether you run zstd-safe (crates.io) or Zstd-Rs Project Zstd-Safe at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • zstd-safe (crates.io): upgrade to 8.2.0 or later
    cargo update -p zstd-safe

Technical details

The InBuffer struct exposes public fields allowing safe Rust code to set the `pos` field beyond the bounds of the `src` buffer. The ZSTD_seekable_compressStream C function does not validate this position before use, unlike other streaming functions, leading to an out-of-bounds read of up to one frame size. The fix checks position bounds before every call to the C library.

Affected products

  • zstd-rs project zstd-safe 7.2.2 to before 8.2.0

Timeline

  • 2026-10-16: disclosed
  • 2026-10-26: advisory
  • 2026-10-26: patched

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.