{"id":"RUSTSEC-2026-0402","title":"Heap buffer overflow in `CCtx::try_clone` on a multithreaded context","summary":"Heap buffer overflow in `CCtx::try_clone` on a multithreaded context","severity":"none","vendor":"zstd-safe","product":"zstd-safe","ecosystem":"rust","affected":["zstd-safe >= 8.0.0-0, < 8.2.0"],"patched":["zstd-safe 8.2.0"],"published":"2026-10-16","updated":"2026-11-02","sourceUpdated":"2026-11-02T09:30:04.162155944Z","source":"OSV","sourceUrl":"https://osv.dev/vulnerability/RUSTSEC-2026-0402","references":[{"url":"https://crates.io/crates/zstd-safe"},{"url":"https://rustsec.org/advisories/RUSTSEC-2026-0402.html"},{"url":"https://github.com/gyscos/zstd-rs/commit/682b8b2967cf4aba5cfe2d940d1e381a3e23211a"},{"url":"https://github.com/gyscos/zstd-rs/pull/384"}],"tags":["osv","rust"],"ingestedAt":"2026-10-27T16:20:12.106Z","slug":"RUSTSEC-2026-0402","body":"## Overview\n\n`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.\n\n## Affected packages\n\n- `zstd-safe >= 8.0.0-0, < 8.2.0`\n\n## Remediation\n\nUpgrade to a patched release:\n\n- `zstd-safe 8.2.0`","depth":"sunlit","depthScore":3,"depthScoreParts":{"impact":2.8,"likelihood":0,"exploitation":0,"ransomware":0},"changes":[]}