Skip to content

RUSTSEC-2026-0398: Seekable::decompress sets a Vec length beyond its capacity for offsets past the end #29

Closed

Description

@github-actions

Seekable::decompress sets a Vec length beyond its capacity for offsets past the end

Details
Package zstd-safe
Version 7.2.4
URL gyscos/zstd-rs@80506be
Date 2026-10-16
Patched versions >=8.2.0
Unaffected versions <7.2.2

ZSTD_seekable_decompress shortens the requested length to the end of the
data without checking that the offset is before it. For an offset past the
end, it returns a wrapped-around length without writing anything, and
Seekable::decompress passed that length to Vec::set_len.

With the seekable feature, whoever supplies the archive, or chooses the
offset, can leave the caller's Vec&lt;u8&gt; with a length far beyond its
capacity. Reading it then discloses neighbouring heap memory, and appending
to it corrupts memory. Offsets near u64::MAX can also hang the call.

The flaw was corrected by clamping requests to the end of the data, and by
checking every count reported by the C library against the buffer capacity.

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