Skip to main content
← All vulnerabilities
RUSTSEC-2026-0404

Double free in `DCtx::try_clone`

Published
Last modified
published
Not listed in CISA KEV
Fix
Fixed in 8.2.0
None on Exploit-DB, Metasploit or GitHub

Summary

This vulnerability affects the Zstandard (zstd) compression library's Rust bindings, specifically the experimental `DCtx::try_clone` decompression-context function. Cloning certain decompression contexts could cause memory to be freed twice, which may crash the application or corrupt memory, and it could also silently drop the window size limit that guards against overly large decompression buffers.

Summarized by anthropic/claude-haiku-5.5. Verify details against the original sources.

Read the original description

`DCtx::try_clone` (`experimental` feature, deprecated) is a plain copy of the C context. A context owning a dictionary (from `load_dictionary`, `ref_prefix` or `init_using_dict`) or a dictionary table (`ref_ddict` with `RefMultipleDDicts`) ended up with both copies freeing it. A context cloned mid-frame resumed on uninitialized stream state. The clone also silently lost the `WindowLogMax` limit. The flaw was corrected by refusing to clone such contexts, and by carrying over the parameters the copy leaves out.

Timeline

  1. Advisory published
  2. Record last updated

Affected versions

  • zstd-safecrates.io

    From 4.1.4 · fixed in 8.2.0

References 4

crates.io

rustsec.org

GitHub · gyscos/zstd-rs