RUSTSEC-2026-0398

Source
https://rustsec.org/advisories/RUSTSEC-2026-0398
Import Source
https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2026-0398.json
JSON Data
https://api.osv.dev/v1/vulns/RUSTSEC-2026-0398
Published
2026-10-16T12:00:00Z
Modified
2026-10-26T14:00:05Z
Summary
`Seekable::decompress` sets a `Vec` length beyond its capacity for offsets past the end
Details

ZSTD_seekable_decompress shortens the requested length to the end of the data without checking that the offset is before it. For an offset past the end, it returns a wrapped-around length without writing anything, and Seekable::decompress passed that length to Vec::set_len.

With the seekable feature, whoever supplies the archive, or chooses the offset, can leave the caller's Vec<u8> with a length far beyond its capacity. Reading it then discloses neighbouring heap memory, and appending to it corrupts memory. Offsets near u64::MAX can also hang the call.

The flaw was corrected by clamping requests to the end of the data, and by checking every count reported by the C library against the buffer capacity.

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
7.2.2
Fixed
8.2.0

Ecosystem specific

{
    "affected_functions":  null,
    "affects":  {
        "arch":  [],
        "functions":  [
            "zstd_safe::seekable::AdvancedSeekable::decompress",
            "zstd_safe::seekable::Seekable::decompress"
        ],
        "os":  []
    }
}

Database specific

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