{"id":"RUSTSEC-2026-0392","summary":"Uninitialized memory exposed by `write::Decoder` on a corrupt legacy frame","details":"From 0.4.22 to 0.7.x, the writer behind `zstd::stream::write::Decoder` set\nits output buffer's length to its full capacity before each decompression\ncall, then to the position the call reported, and only checked for an error\nafterwards. When decompression fails inside a legacy (zstd v0.4 to v0.7)\nframe, the bundled zstd library reports the output as fully written although\nnothing was written, so stale heap memory, up to the buffer size (32 KiB by\ndefault), was passed to the wrapped writer.\n\nLegacy support is enabled by default, and a few bytes of corrupt legacy\nframe are enough. Whether this reaches an attacker depends on where the\napplication sends the decompressed output.\n\nFrom 0.8.0, the writer uses zstd-safe's buffers, and the same flaw there is\ncovered by the zstd-safe advisory for it, fixed in zstd-safe 8.2.0.","modified":"2026-10-26T14:00:05.805080316Z","published":"2026-10-16T12:00:00Z","database_specific":{"license":"CC0-1.0"},"references":[{"type":"PACKAGE","url":"https://crates.io/crates/zstd"},{"type":"ADVISORY","url":"https://rustsec.org/advisories/RUSTSEC-2026-0392.html"},{"type":"WEB","url":"https://github.com/gyscos/zstd-rs/commit/006e1d1ad1eeaf6b5d4c28329e70217adabcec43"},{"type":"WEB","url":"https://github.com/gyscos/zstd-rs/pull/384"}],"affected":[{"package":{"name":"zstd","ecosystem":"crates.io","purl":"pkg:cargo/zstd"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0.4.22"},{"fixed":"0.8.0"}]}],"ecosystem_specific":{"affected_functions":null,"affects":{"functions":[],"arch":[],"os":[]}},"database_specific":{"categories":["memory-exposure"],"cvss":null,"informational":null,"source":"https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2026-0392.json"}}],"schema_version":"1.9.0"}