# RUSTSEC-2026-0402: Heap buffer overflow in `CCtx::try_clone` on a multithreaded context

- 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:04.162Z

## Description

`CCtx::try_clone` (`experimental` feature, deprecated) copies tables sized
from the context's applied parameters. Starting a multithreaded frame
(`zstdmt` feature) replaces those parameters with the workers' without
resizing the context's own tables, so after an abandoned single-threaded
frame, the copy wrote up to 512 KiB past a heap allocation, or read past
one. This became reachable with the bundled zstd 1.5.6.

The flaw was corrected by refusing `try_clone` (and the unsafe
`compress_block`) once `NbWorkers` was set on the context.

(As written by RustSec Advisory Database.)

## Affected

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

## Sources

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

---

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