Skip to main content
VulnerabilityPublished Updated

Zstd safe: Use-after-free with `CParameter::StableInBuffer`

Affects zstd-safeSource GCVE Database

0
Severity
Unrated

Rated by Threat Radar

Patch
Available – fixed in 8.2.0

Data as of 26 Oct 2026, 16:13 UTC

What to do

Upgrade zstd-safe to 8.2.0.

Affected software

ProductAffectedFixed in
crates.iozstd-safepkg:cargo/zstd-safeOther threatsAffected
  • >=4.1.0 <8.2.0
Fixed in
  • 8.2.0

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

Description

With `CParameter::StableInBuffer(true)` (`experimental` feature), the C library keeps a pointer to the input of one streaming call and reads from it in later calls, including `flush_stream` and `end_stream`, which take no input. An `InBuffer` only borrows its slice for one call, so safe code could free it in between, and freed memory was compressed into the frame. The C library behaves this way since zstd 1.5.4, whether bundled or linked from the system. The flaw was corrected by refusing to enable the parameter.

References

Community reviews

Loading reviews…