# RUSTSEC-2026-0391: Data from an abandoned stream leaks into the next stream on a reused context

- Severity: not scored yet
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2026-10-16T12:00:00.000Z
- Modified: 2026-11-02T09:30:03.590Z

## Description

The `with_context` constructors of the stream encoders and decoders used the
borrowed context as it was. When a stream was abandoned on a context, for
example an encoder dropped before `finish()` after an error, whatever it
left there was carried into the next stream: the input buffered by the
previous encoder (up to 128 KiB, or all of it with `zstdmt`) became the
start of the next frame, and a decoder returned undelivered output of the
previous stream.

An application reusing one context for data that must stay separate, such
as different users' requests, could disclose one user's plaintext to
another. Whoever supplies the data can cause the abandonment with invalid
input.

The flaw was corrected by resetting the context's session in
`with_context`.

(As written by RustSec Advisory Database.)

## Affected

- zstd (crates.io): from 0.13.2 before 0.13.4; from 0.14.0-0 before 0.14.3

## References

- <https://crates.io/crates/zstd> (package)
- <https://rustsec.org/advisories/RUSTSEC-2026-0391.html> (advisory)
- <https://github.com/gyscos/zstd-rs/commit/74ace2dcdca62a2ce0f034895d6079458311e003> (web)
- <https://github.com/gyscos/zstd-rs/pull/384> (web)

## Sources

- RustSec Advisory Database: [RUSTSEC-2026-0391](https://rustsec.org/advisories/RUSTSEC-2026-0391.html), CC0-1.0, modified 2026-11-02

---

Page: https://cve.day/RUSTSEC-2026-0391 · Whole record: https://cve.day/RUSTSEC-2026-0391.json · Rebuilt by cve.day 2026-11-25T22:56:43.449Z
