—
RUSTSEC-2026-0405
Out-of-bounds read with an out-of-range `InBuffer::pos`
Details
`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.
Are you affected?
Enter the version of the package you're using.
Affected packages
crates.io/zstd-safe
Introduced in:
7.2.2Fixed in: 7.4.0Upgrade zstd-safe to 7.4.0 or newer (ecosystem crates.io).