# zstd data leak from abandoned stream on reused context

Source: https://junglewise.ai/threats/rustsec-2026-0391-data-from-an-abandoned-stream-leaks-into-the-next-dc6833d2  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-10-16. Updated: 2026-10-28  
License: CC BY 4.0 with a link back

Severity: info · Published 2026-10-16

The zstd Rust library improperly handles compression/decompression contexts when streams are abandoned before completion. If an application reuses the same context to process separate data (such as requests from different users), plaintext from a previous stream can leak into the next stream, causing information disclosure. An attacker who supplies invalid data can trigger the abandonment condition.

Technologies: [zstd (crates.io)](https://junglewise.ai/threats/technologies/crates-io-zstd). Vendors: [crates.io](https://junglewise.ai/threats/vendors/crates-io).

## Quick answers

**Is This vulnerability exploited in the wild?** No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.

**How severe is This vulnerability?** Informational severity, published 16 October 2026.

**Which products and versions are affected?** zstd (crates.io) SEMVER:introduced=0.13.2,fixed=0.14.3; Zstd 0.13.2 to 0.14.2.

**Is there a fix for This vulnerability?** Yes. zstd (crates.io): upgrade to 0.14.3 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is This vulnerability attacked?** It is attacked over the network, in a software library.

**Am I affected?** Check whether you run zstd (crates.io) or Zstd at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- zstd (crates.io): upgrade to 0.14.3 or later

  ```sh
  cargo update -p zstd
  ```


## Technical details

The with_context constructors in zstd::stream::raw::Encoder and Decoder fail to reset the context's session state when a stream is abandoned before finish() is called. This leaves buffered input (up to 128 KiB, or all of it with zstdmt) and undelivered output in the context, which then becomes part of the next frame when the same context is reused. An attacker supplying invalid input can trigger early stream abandonment, causing data leakage between logically separate operations.

## Affected products

- zstd 0.13.2 to 0.14.2

## Timeline

- 2026-10-16: disclosed
- 2026-10-26: patched

## References

- [https://crates.io/crates/zstd](https://crates.io/crates/zstd)
- [https://rustsec.org/advisories/RUSTSEC-2026-0391.html](https://rustsec.org/advisories/RUSTSEC-2026-0391.html)

## Related threats

- [zstd out-of-bounds read in dictionary training from inconsistent samples](https://junglewise.ai/threats/rustsec-2026-0393-out-of-bounds-read-when-training-a-dictionary-from-429f94fd)
- [zstd memory exposure in write::Decoder on corrupt legacy frame](https://junglewise.ai/threats/rustsec-2026-0392-uninitialized-memory-exposed-by-write-decoder-on-a-fa4c4e49)
