{"id":"RUSTSEC-2026-0391","summary":"Data from an abandoned stream leaks into the next stream on a reused context","details":"The `with_context` constructors of the stream encoders and decoders used the\nborrowed context as it was. When a stream was abandoned on a context, for\nexample an encoder dropped before `finish()` after an error, whatever it\nleft there was carried into the next stream: the input buffered by the\nprevious encoder (up to 128 KiB, or all of it with `zstdmt`) became the\nstart of the next frame, and a decoder returned undelivered output of the\nprevious stream.\n\nAn application reusing one context for data that must stay separate, such\nas different users' requests, could disclose one user's plaintext to\nanother. Whoever supplies the data can cause the abandonment with invalid\ninput.\n\nThe flaw was corrected by resetting the context's session in\n`with_context`.","modified":"2026-10-26T14:00:04.269245609Z","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-0391.html"},{"type":"WEB","url":"https://github.com/gyscos/zstd-rs/commit/74ace2dcdca62a2ce0f034895d6079458311e003"},{"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.13.2"},{"fixed":"0.14.3"}]}],"ecosystem_specific":{"affects":{"functions":["zstd::stream::raw::Decoder::with_context","zstd::stream::raw::Encoder::with_context"],"arch":[],"os":[]},"affected_functions":null},"database_specific":{"categories":["memory-exposure"],"cvss":null,"informational":null,"source":"https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2026-0391.json"}}],"schema_version":"1.9.0"}