Skip to content

fix(cursor): reject overflowing terminating 64-bit protobuf varints #750

Closed

Description

@outlier27-cell

Problem

Reader.int64() accepts an invalid terminating tenth byte whose payload exceeds the one remaining bit of a 64-bit protobuf varint. Nine 0x80 bytes followed by 0x7f is 70 bits wide, but the decoder passes it through BigInt.asIntN(64, ...) and silently truncates it.

Reproduction

Decode a message containing an int64 field encoded as 08 80 80 80 80 80 80 80 80 80 7f. It currently succeeds instead of rejecting the malformed varint.

Expected

The decoder should reject a terminating tenth byte with payload greater than 0x01, while continuing to accept valid 64-bit boundary values.

Scope

This is distinct from #748: it covers the 64-bit decoder and its ten-byte bound, rather than uint32's five-byte bound.

Activity

  1. outlier27-cell commented on Oct 11, 2026

    @outlier27-cell
    ContributorAuthor

    我来认领这个问题:将补充非法第十字节的回归用例,并在 Reader.int64 中拒绝超过 64 位的终止 varint。

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