Out-of-bounds read in `train_from_buffer` when sample sizes overflow
- Published
- Last modified
- Where the record stands: published, rejected by its publisher, or superseded by another id.What do these mean? →
- published
- Whether CISA lists it in its Known Exploited Vulnerabilities catalog: proof that attackers are using it.What do these mean? →
- Not listed in CISA KEV
- Fix
- Fixed in 8.2.0
- Whether working attack code is public (Exploit-DB, Metasploit, Nuclei or GitHub). Public code makes attacks easier.What do these mean? →
- None on Exploit-DB, Metasploit or GitHub
Summary
The affected software is the Rust `zstd` crate's dictionary training feature (`zstd::dict::from_continuous`), which uses the zstd dictionary trainer. A flaw in how sample sizes are summed can let an attacker-influenced input cause the trainer to read past the end of a buffer, but only when those sample sizes come from an untrusted source.
Summarized by anthropic/claude-haiku-5.5. Verify details against the original sources.
Read the original description
`ZDICT_trainFromBuffer` is never told the length of the samples buffer, so `train_from_buffer` checked that the sample sizes add up to it. With overflow checks off, as in release builds, that sum wrapped around: sizes totalling 2^64 plus the buffer length passed the check, and the trainer read past the end of the buffer. `zstd::dict::from_continuous` relies on this check from zstd 0.4.10; older versions of zstd had their own, covered by a separate advisory. This requires the sample sizes to come from an untrusted source. The flaw was corrected by summing the sizes with overflow checks.
Timeline
- Advisory published
- Record last updated
Affected versions
- zstd-safecrates.io
From 0.0.0-0 · fixed in 8.2.0