RUSTSEC-2026-0395

published 16 Oct 2026 · updated 2 Nov 2026

Use-after-free with `CParameter::StableInBuffer`

5.0Medium

No exploitation in the wild has been reported. Fixed in zstd-safe 8.2.0.

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

Vendors, products and packages with version ranges

VendorProductVersionsFixed
cargo: zstd-safe>=8.0.0-0 <8.2.08.2.0

Timeline

Every event on this vulnerability

Related

Other vulnerabilities in zstd-safe (Cargo), strongest first

Embed

A live severity badge for an advisory, README or ticket

RUSTSEC-2026-0395 severity on Zeptric[![RUSTSEC-2026-0395](https://zeptric.io/badge/cve/RUSTSEC-2026-0395.svg)](https://zeptric.io/cve/RUSTSEC-2026-0395)