RUSTSEC-2026-0395

Source
https://rustsec.org/advisories/RUSTSEC-2026-0395
Import Source
https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2026-0395.json
JSON Data
https://api.osv.dev/v1/vulns/RUSTSEC-2026-0395
Published
2026-10-16T12:00:00Z
Modified
2026-10-26T14:00:06Z
Summary
Use-after-free with `CParameter::StableInBuffer`
Details

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.

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

Ecosystem specific

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

Database specific

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