RUSTSEC-2026-0401

Source
https://rustsec.org/advisories/RUSTSEC-2026-0401
Import Source
https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2026-0401.json
JSON Data
https://api.osv.dev/v1/vulns/RUSTSEC-2026-0401
Published
2026-10-16T12:00:00Z
Modified
2026-10-26T14:00:04Z
Summary
Out-of-bounds read in `train_from_buffer` when sample sizes overflow
Details

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.

Database specific
{
    "license":  "CC0-1.0"
}
References

Affected packages

crates.io / zstd-safe

Package

Name
zstd-safe
View open source insights on deps.dev
Purl
pkg:cargo/zstd-safe

Affected ranges

Type
SEMVER
Events
Introduced
0.0.0-0
Fixed
8.2.0

Ecosystem specific

{
    "affected_functions":  null,
    "affects":  {
        "arch":  [],
        "functions":  [
            "zstd_safe::train_from_buffer"
        ],
        "os":  []
    }
}

Database specific

categories
[
    "memory-exposure"
]
cvss
null
informational
"unsound"
source
"https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2026-0401.json"