RUSTSEC-2026-0399

published 16 Oct 2026 · updated 2 Nov 2026

Use-after-free through `init_using_cdict` and `init_using_ddict`

5.0Medium

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

`CCtx::init_using_cdict` and `DCtx::init_using_ddict` (`experimental` feature, deprecated) took the dictionary as `&CDict<'b>` and `&DDict<'b>` with only `'b: 'a`, so the dictionary itself could be dropped while the context still pointed at it. The same mistake in other constructors was fixed earlier (<https://github.com/gyscos/zstd-rs/issues/365>). The flaw was corrected by taking `&'a CDict<'b>` and `&'a DDict<'b>`.

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-0399 severity on Zeptric[![RUSTSEC-2026-0399](https://zeptric.io/badge/cve/RUSTSEC-2026-0399.svg)](https://zeptric.io/cve/RUSTSEC-2026-0399)