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

- Severity: not scored yet
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2026-10-16T12:00:00.000Z
- Modified: 2026-11-02T09:30:03.399Z

## 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.

(As written by RustSec Advisory Database.)

## Affected

- zstd-safe (crates.io): from 7.2.2 before 7.4.0; from 8.0.0-0 before 8.2.0

## References

- <https://crates.io/crates/zstd-safe> (package)
- <https://rustsec.org/advisories/RUSTSEC-2026-0405.html> (advisory)
- <https://github.com/gyscos/zstd-rs/commit/20d397c0d68d8b4300c5493875ebfa10e355fcdd> (web)
- <https://github.com/gyscos/zstd-rs/pull/384> (web)

## Sources

- RustSec Advisory Database: [RUSTSEC-2026-0405](https://rustsec.org/advisories/RUSTSEC-2026-0405.html), CC0-1.0, modified 2026-11-02

---

Page: https://cve.day/RUSTSEC-2026-0405 · Whole record: https://cve.day/RUSTSEC-2026-0405.json · Rebuilt by cve.day 2026-11-25T22:56:43.452Z
