Skip to content
Heist/ feed
Back to feed
UnratedFix available

Data from an abandoned stream leaks into the next stream on a reused context

Type: advisorySources: OSV

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`.

Products
zstd
Affected versions
Not specified
Fixed versions
0.14.3
CVEs
Not specified
Confirmed fixed CVEs
Not specified
Updated in this feed
1 Nov 2026, 14:47 UTC · Revision 1

Source evidence

Data from an abandoned stream leaks into the next stream on a reused context

core-osv · Original source

Published 16 Oct 2026, 12:00 UTC

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`.

osv:RUSTSEC-2026-0391

zstd

Fixed versions: 0.14.3

Complete source record
{
  "id": "e234fb1832f0244c9810d0bd0eb415bd360cf8d78f5237fbe22f59ec2c67da60",
  "url": "https://osv.dev/vulnerability/RUSTSEC-2026-0391",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Data from an abandoned stream leaks into the next stream on a reused context",
    "summary": "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`.",
    "evidence": "osv:RUSTSEC-2026-0391",
    "products": [
      {
        "name": {
          "value": "zstd",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "0.14.3",
            "evidence": "/affected/0/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "unknown",
    "structured": {
      "id": "RUSTSEC-2026-0391",
      "aliases": [
        "RUSTSEC-2026-0391"
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "SEMVER",
              "events": [
                {
                  "introduced": "0.13.2"
                },
                {
                  "fixed": "0.14.3"
                }
              ]
            }
          ],
          "package": {
            "name": "zstd",
            "purl": "pkg:cargo/zstd",
            "ecosystem": "crates.io"
          },
          "database_specific": {
            "cvss": null,
            "source": "https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2026-0391.json",
            "categories": [
              "memory-exposure"
            ],
            "informational": null
          },
          "ecosystem_specific": {
            "affects": {
              "os": [],
              "arch": [],
              "functions": [
                "zstd::stream::raw::Decoder::with_context",
                "zstd::stream::raw::Encoder::with_context"
              ]
            },
            "affected_functions": null
          }
        }
      ],
      "modified": "2026-10-26T14:00:04.269245609Z",
      "provider": "osv",
      "references": [
        "https://crates.io/crates/zstd",
        "https://rustsec.org/advisories/RUSTSEC-2026-0391.html",
        "https://github.com/gyscos/zstd-rs/commit/74ace2dcdca62a2ce0f034895d6079458311e003",
        "https://github.com/gyscos/zstd-rs/pull/384"
      ],
      "provider_metadata": {
        "license": "CC0-1.0"
      }
    },
    "related_cves": [],
    "security_relevant": true,
    "severity_evidence": null
  },
  "source_id": "core-osv",
  "document_id": 454188,
  "published_at": "2026-10-16T12:00:00+00:00"
}