Skip to content

RUSTSEC-2026-0402: Heap buffer overflow in CCtx::try_clone on a multithreaded context #37

Closed

Description

@github-actions

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

Details
Status unsound
Package zstd-safe
Version 7.2.4
URL gyscos/zstd-rs@682b8b2
Date 2026-10-16

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.

See advisory page for additional details.

Activity

  1. adwk67 commented on Oct 27, 2026

    @adwk67
    Member

    fixed by #42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions