{"id":"RUSTSEC-2026-0406","aliases":["RUSTSEC-2026-0406"],"related":[],"kind":"vulnerability","state":"published","title":"Use-after-free when changing a multithreaded context with an unfinished frame","summary":"When a multithreaded frame (`zstdmt` feature, `CParameter::NbWorkers`) is\nleft unfinished, its jobs may still be running on the worker threads: the C\nlibrary only waits for them when the next frame starts, or when the context\nis freed. A session reset makes the context accept changes again in the\nmeantime, so:\n\n- unloading the dictionary (`load_dictionary`, `ref_cdict`, `ref_prefix`,\n  `disable_dictionary`, `init*`, or `reset` with parameters) freed the\n  dictionary a worker was still compressing against;\n- changing `NbWorkers` made the next frame resize the job table before\n  waiting for the old jobs.\n\nThe flaw was corrected by refusing these calls while a multithreaded frame\nis unfinished. The new `CCtx::wait_for_workers()` waits for the workers\nfirst.","summaryFormat":"markdown","summarySource":"rustsec","descriptions":[{"lang":"en","text":"When a multithreaded frame (`zstdmt` feature, `CParameter::NbWorkers`) is\nleft unfinished, its jobs may still be running on the worker threads: the C\nlibrary only waits for them when the next frame starts, or when the context\nis freed. A session reset makes the context accept changes again in the\nmeantime, so:\n\n- unloading the dictionary (`load_dictionary`, `ref_cdict`, `ref_prefix`,\n  `disable_dictionary`, `init*`, or `reset` with parameters) freed the\n  dictionary a worker was still compressing against;\n- changing `NbWorkers` made the next frame resize the job table before\n  waiting for the old jobs.\n\nThe flaw was corrected by refusing these calls while a multithreaded frame\nis unfinished. The new `CCtx::wait_for_workers()` waits for the workers\nfirst.","format":"markdown","source":"rustsec"}],"published":"2026-10-16T12:00:00.000Z","modified":"2026-11-02T09:30:03.591Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"semver","introduced":"0.0.0-0","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-0406.html","tags":["advisory"],"sources":["rustsec"]},{"url":"https://github.com/gyscos/zstd-rs/commit/e224018a2389915d68ed17f30109bebad36e9734","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-0406","url":"https://rustsec.org/advisories/RUSTSEC-2026-0406.html","licence":"CC0-1.0","modified":"2026-11-02T09:30:03.591Z"}],"updatedAt":"2026-11-25T22:56:43.453Z"}