Intel

AIKIDO-2026-542614

zstd-safe is vulnerable to Use After Free

Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published Sep 23, 2026
September 23, 2026

35

CVE Score

Low

Use After Free

Are you affected? Scan for Free

TL;DR

AdvancedSeekable implements DerefMut, exposing a mutable reference to its inner Seekable context while a raw pointer to the boxed reader stays behind in the same struct. Safe code can call mem::swap on that reference to move the C context into an unrelated Seekable value, and dropping the original AdvancedSeekable then frees the boxed reader while the swapped-in context still holds a pointer into it. A later decompression call on the swapped context dereferences that freed reader through the FFI read/seek callbacks, producing a heap use after free. The fix removes the DerefMut implementation so callers can no longer split the context from its backing reader.

How do I fix this?

Upgrade the zstd-safe library to the patch version.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and you use the seekable feature's AdvancedSeekable decompression wrapper.

Package

Versions

7.2.2 - 7.3.0

Fixed in 8.0.0

Background info

zstd-safe is vulnerable to Use After Free in versions 7.2.2 - 7.3.0.

Get secure today,
quickly and for free.

Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.

No credit card required | Scan results in 32 seconds.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea