{"id":"RUSTSEC-2026-0402","aliases":["RUSTSEC-2026-0402"],"related":[],"kind":"vulnerability","state":"published","title":"Heap buffer overflow in `CCtx::try_clone` on a multithreaded context","summary":"`CCtx::try_clone` (`experimental` feature, deprecated) copies tables sized\nfrom the context's applied parameters. Starting a multithreaded frame\n(`zstdmt` feature) replaces those parameters with the workers' without\nresizing the context's own tables, so after an abandoned single-threaded\nframe, the copy wrote up to 512 KiB past a heap allocation, or read past\none. This became reachable with the bundled zstd 1.5.6.\n\nThe flaw was corrected by refusing `try_clone` (and the unsafe\n`compress_block`) once `NbWorkers` was set on the context.","summaryFormat":"markdown","summarySource":"rustsec","descriptions":[{"lang":"en","text":"`CCtx::try_clone` (`experimental` feature, deprecated) copies tables sized\nfrom the context's applied parameters. Starting a multithreaded frame\n(`zstdmt` feature) replaces those parameters with the workers' without\nresizing the context's own tables, so after an abandoned single-threaded\nframe, the copy wrote up to 512 KiB past a heap allocation, or read past\none. This became reachable with the bundled zstd 1.5.6.\n\nThe flaw was corrected by refusing `try_clone` (and the unsafe\n`compress_block`) once `NbWorkers` was set on the context.","format":"markdown","source":"rustsec"}],"published":"2026-10-16T12:00:00.000Z","modified":"2026-11-02T09:30:04.162Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"semver","introduced":"4.1.4","status":"affected","fixed":"7.4.0"},{"type":"semver","introduced":"8.0.0-0","status":"affected","fixed":"8.2.0"}],"ecosystem":"crates.io","package":"zstd-safe","purl":"pkg:cargo/zstd-safe","source":"rustsec"}],"references":[{"url":"https://crates.io/crates/zstd-safe","tags":["package"],"sources":["rustsec"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2026-0402.html","tags":["advisory"],"sources":["rustsec"]},{"url":"https://github.com/gyscos/zstd-rs/commit/682b8b2967cf4aba5cfe2d940d1e381a3e23211a","tags":["web"],"sources":["rustsec"]},{"url":"https://github.com/gyscos/zstd-rs/pull/384","tags":["web"],"sources":["rustsec"]}],"credits":[],"sources":[{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2026-0402","url":"https://rustsec.org/advisories/RUSTSEC-2026-0402.html","licence":"CC0-1.0","modified":"2026-11-02T09:30:04.162Z"}],"updatedAt":"2026-11-25T22:56:43.452Z"}