{"id":"RUSTSEC-2026-0399","summary":"Use-after-free through `init_using_cdict` and `init_using_ddict`","details":"`CCtx::init_using_cdict` and `DCtx::init_using_ddict` (`experimental`\nfeature, deprecated) took the dictionary as `&CDict\u003c'b\u003e` and `&DDict\u003c'b\u003e`\nwith only `'b: 'a`, so the dictionary itself could be dropped while the\ncontext still pointed at it. The same mistake in other constructors was\nfixed earlier (\u003chttps://github.com/gyscos/zstd-rs/issues/365\u003e).\n\nThe flaw was corrected by taking `&'a CDict\u003c'b\u003e` and `&'a DDict\u003c'b\u003e`.","modified":"2026-10-26T14:00:05.792431051Z","published":"2026-10-16T12:00:00Z","database_specific":{"license":"CC0-1.0"},"references":[{"type":"PACKAGE","url":"https://crates.io/crates/zstd-safe"},{"type":"ADVISORY","url":"https://rustsec.org/advisories/RUSTSEC-2026-0399.html"},{"type":"WEB","url":"https://github.com/gyscos/zstd-rs/commit/e00e7928e3e98953fc43418af6d73f6aae2378fb"},{"type":"WEB","url":"https://github.com/gyscos/zstd-rs/pull/384"}],"affected":[{"package":{"name":"zstd-safe","ecosystem":"crates.io","purl":"pkg:cargo/zstd-safe"},"ranges":[{"type":"SEMVER","events":[{"introduced":"3.0.0"},{"fixed":"8.2.0"}]}],"ecosystem_specific":{"affected_functions":null,"affects":{"os":[],"functions":["zstd_safe::CCtx::init_using_cdict","zstd_safe::DCtx::init_using_ddict"],"arch":[]}},"database_specific":{"informational":"unsound","source":"https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2026-0399.json","categories":["memory-corruption"],"cvss":null}}],"schema_version":"1.9.0"}