Skip to content

fix: close review issues #6-#13 on 3.4.0 - #25695

Merged
godsflaw merged 3 commits into
msgpack:masterfrom
enochgroot:fix/review-open-master
Sep 22, 2026
Merged

godsflaw merged 3 commits into
msgpack:masterfrom
enochgroot:fix/review-open-master

Conversation

@enochgroot

@enochgroot enochgroot commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator

Rebase of the OPEN review follow-ups onto live upstream master (c0f78a1, 3.4.0).

The earlier fork PR (#14 on enochgroot/msgpack-node) was based on a stale 2.0 line, so Stream drain/backpressure from #43 would have been dropped. This branch's first commit parent is c0f78a1.

Fixes

  • Pin nan 2.28.0 and c8 12.0.0; CI uses npm ci on Node 22 with full-SHA Actions
  • engines.node is ^22 (Node 24 is not advertised: lazy unpack still uses SetIndexedPropertyHandler, which Node 24 V8 removed)
  • Cap Stream receive before allocate (MAX_STREAM_BYTES); drop buf on close/end/error
  • Re-emit underlying socket errors when the Stream is not already dead (a socket error is no longer swallowed)
  • Apply kMaxContainer to pack array/map walks (Length freeze)
  • Cap CLI stdin concat at MAX_STDIN_BYTES
  • Document a risk-based bump window in SECURITY.md

Verification

  • npm test: 240 pass, 0 fail
  • JS coverage (c8 95% gate): statements 100, branches 98.71, functions 100, lines 100
  • Sabotage: stream cap, socket re-emit, rejectLimit skip-when-dead, CLI stdin cap, and pack Length tests all fail when the matching guard is removed, then restored

Fixes #25696
Fixes #25697
Fixes #25698
Fixes #25699
Fixes #25700
Fixes #25701
Fixes #25702
Fixes #25703

Rebase the OPEN review follow-ups onto live upstream master
(c0f78a1, 3.4.0) so Stream drain/backpressure from msgpack#43 is kept.

Pin nan 2.28.0 and c8 12.0.0; CI uses npm ci on Node 22/24 with
full-SHA GitHub Actions. engines.node is >=22.

Cap Stream receive before allocate and drop buf on close/end/error.
Re-emit underlying socket errors when the Stream is not already dead
so a socket 'error' is not swallowed by the listener.

Apply kMaxContainer to pack array/map walks. Cap CLI stdin concat
at MAX_STDIN_BYTES. Document a risk-based bump window in SECURITY.md.
InitLazy still calls ObjectTemplate::SetIndexedPropertyHandler,
which Node 24 V8 headers no longer provide. Parent never tested 24.

engines.node is ^22 so 24 is not advertised. CI matrix is [22] only.
Snapshot Length() once, throw when n > 1e6, and iterate the frozen n
so interpret cannot walk a sparse array past the PackArray policy.
@godsflaw
godsflaw merged commit 4f93644 into msgpack:master Sep 22, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment