{"id":"RUSTSEC-2026-0406","aliases":[],"title":"Use-after-free when changing a multithreaded context with an unfinished frame","titleSource":"OSV","descriptionSource":"OSV","description":"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.","severity":"unknown","score":null,"published":"2026-10-16T12:00:00.000Z","modified":"2026-11-02T09:30:03.591Z","withdrawn":false,"knownExploited":false,"affected":[{"ecosystem":"crates.io","name":"zstd-safe","sources":[{"name":"OSV · RUSTSEC-2026-0406","url":"https://osv.dev/vulnerability/RUSTSEC-2026-0406"}],"ranges":[{"events":[{"introduced":"0.0.0-0"},{"fixed":"7.4.0"},{"introduced":"8.0.0-0"},{"fixed":"8.2.0"}],"type":"SEMVER"}],"versions":[],"fixed":["7.4.0","8.2.0"]}],"sourceAffected":[],"references":["https://crates.io/crates/zstd-safe","https://rustsec.org/advisories/RUSTSEC-2026-0406.html","https://github.com/gyscos/zstd-rs/commit/e224018a2389915d68ed17f30109bebad36e9734","https://github.com/gyscos/zstd-rs/pull/384"],"sources":[{"name":"OSV","id":"RUSTSEC-2026-0406","modified":"2026-11-02T09:30:03.591194710Z","url":"https://osv.dev/vulnerability/RUSTSEC-2026-0406"}],"assessments":[],"products":[],"remediation":[],"observedAt":"2026-11-02T09:40:45.107Z","kev":{"status":"unavailable","checkedAt":"2026-11-29T00:45:31.076Z"},"coverage":[{"source":"NVD","status":"not-checked"},{"source":"GHSA","status":"not-checked"},{"source":"EUVD","status":"not-checked"},{"source":"EPSS","status":"not-checked"}],"evidence":[],"aiSummary":null}