Skip to content

Cap pack() array Length walk (same 1e6 policy as unpack) #10

Description

@enochgroot

Unpack rejects array/map n > 1e6. pack() does not.

PackArray snapshots Array::Length() and walks that many elements with no policy cap. pack(arr, { interpret }) re-reads Length() for the header and the loop, so a getter that grows length extends the walk. Depth is still 512; size is not.

Apply kMaxContainer (and freeze n for the interpret loop) before packing arrays/maps. Reject sparse huge Length() the same way ScanOne rejects huge headers.

Activity

  1. enochgroot commented on Sep 21, 2026

    @enochgroot
    OwnerAuthor

    Implemented in #14 (branch fix/review-open-6-13).

  2. enochgroot commented on Sep 22, 2026

    @enochgroot
    OwnerAuthor

    Tracked upstream: msgpack#25700

    Closing this fork issue as a duplicate of that ticket. Numbering on enochgroot/msgpack-node is a different sequence from msgpack/msgpack-node.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions