# RUSTSEC-2026-0399: Use-after-free through `init_using_cdict` and `init_using_ddict`

- 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.328Z

## Description

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

(As written by RustSec Advisory Database.)

## Affected

- zstd-safe (crates.io): from 3.0.0 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-0399.html> (advisory)
- <https://github.com/gyscos/zstd-rs/commit/e00e7928e3e98953fc43418af6d73f6aae2378fb> (web)
- <https://github.com/gyscos/zstd-rs/pull/384> (web)

## Sources

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

---

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