Skip to content
Heist/ feed
Back to feed
UnratedFix available

Heap buffer overflow in `CCtx::try_clone` on a multithreaded context

Type: advisorySources: OSV

`CCtx::try_clone` (`experimental` feature, deprecated) copies tables sized from the context's applied parameters. Starting a multithreaded frame (`zstdmt` feature) replaces those parameters with the workers' without resizing the context's own tables, so after an abandoned single-threaded frame, the copy wrote up to 512 KiB past a heap allocation, or read past one. This became reachable with the bundled zstd 1.5.6. The flaw was corrected by refusing `try_clone` (and the unsafe `compress_block`) once `NbWorkers` was set on the context.

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

Source evidence

Heap buffer overflow in `CCtx::try_clone` on a multithreaded context

core-osv · Original source

Published 16 Oct 2026, 12:00 UTC

`CCtx::try_clone` (`experimental` feature, deprecated) copies tables sized from the context's applied parameters. Starting a multithreaded frame (`zstdmt` feature) replaces those parameters with the workers' without resizing the context's own tables, so after an abandoned single-threaded frame, the copy wrote up to 512 KiB past a heap allocation, or read past one. This became reachable with the bundled zstd 1.5.6. The flaw was corrected by refusing `try_clone` (and the unsafe `compress_block`) once `NbWorkers` was set on the context.

osv:RUSTSEC-2026-0402

zstd-safe

Fixed versions: 8.2.0

Complete source record
{
  "id": "d646e284637f3ce1faec596e1596b8b23557db78f710e3d4df1b0b0c6712d702",
  "url": "https://osv.dev/vulnerability/RUSTSEC-2026-0402",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Heap buffer overflow in `CCtx::try_clone` on a multithreaded context",
    "summary": "`CCtx::try_clone` (`experimental` feature, deprecated) copies tables sized from the context's applied parameters. Starting a multithreaded frame (`zstdmt` feature) replaces those parameters with the workers' without resizing the context's own tables, so after an abandoned single-threaded frame, the copy wrote up to 512 KiB past a heap allocation, or read past one. This became reachable with the bundled zstd 1.5.6. The flaw was corrected by refusing `try_clone` (and the unsafe `compress_block`) once `NbWorkers` was set on the context.",
    "evidence": "osv:RUSTSEC-2026-0402",
    "products": [
      {
        "name": {
          "value": "zstd-safe",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "8.2.0",
            "evidence": "/affected/0/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "unknown",
    "structured": {
      "id": "RUSTSEC-2026-0402",
      "aliases": [
        "RUSTSEC-2026-0402"
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "SEMVER",
              "events": [
                {
                  "introduced": "4.1.4"
                },
                {
                  "fixed": "8.2.0"
                }
              ]
            }
          ],
          "package": {
            "name": "zstd-safe",
            "purl": "pkg:cargo/zstd-safe",
            "ecosystem": "crates.io"
          },
          "database_specific": {
            "cvss": null,
            "source": "https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2026-0402.json",
            "categories": [
              "memory-corruption"
            ],
            "informational": "unsound"
          },
          "ecosystem_specific": {
            "affects": {
              "os": [],
              "arch": [],
              "functions": [
                "zstd_safe::CCtx::try_clone"
              ]
            },
            "affected_functions": null
          }
        }
      ],
      "modified": "2026-10-26T14:00:05.685817733Z",
      "provider": "osv",
      "references": [
        "https://crates.io/crates/zstd-safe",
        "https://rustsec.org/advisories/RUSTSEC-2026-0402.html",
        "https://github.com/gyscos/zstd-rs/commit/682b8b2967cf4aba5cfe2d940d1e381a3e23211a",
        "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": 454195,
  "published_at": "2026-10-16T12:00:00+00:00"
}