RUSTSEC-2026-0395
not scored yetUse-after-free with `CParameter::StableInBuffer`
With CParameter::StableInBuffer(true) (experimental feature), the C
library keeps a pointer to the input of one streaming call and reads from it
in later calls, including flush_stream and end_stream, which take no
input. An InBuffer only borrows its slice for one call, so safe code could
free it in between, and freed memory was compressed into the frame. The C
library behaves this way since zstd 1.5.4, whether bundled or linked from the
system.
The flaw was corrected by refusing to enable the parameter.
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| OSV | crates.io | zstd-safe | >= 4.1.0, < 7.4.0; >= 8.0.0-0, < 8.2.0 | 7.4.0, 8.2.0 |
References
- https://crates.io/crates/zstd-safe · PACKAGE
- https://rustsec.org/advisories/RUSTSEC-2026-0395.html · ADVISORY
- https://github.com/gyscos/zstd-rs/commit/53a8a290d8cfb52ff5b29fb6e04a40b5a174cc65 · WEB
- https://github.com/gyscos/zstd-rs/pull/384 · WEB
History
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 16 Oct 2026)