Repository navigation
fix(node-sea): bound duplicate blob verification work - #11066
ShuaixinHuang wants to merge 1 commit into
Conversation
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Medium impact] The PR appears safe to merge; no actionable defects were found. SummaryBounds duplicate Node SEA blob verification in the shared owner used by Mach-O, ELF, and PE.
No actionable issues found. Review checks were source-based; tests were not run. Whether another PR supersedes this one could not be checked because GitHub access was unavailable. Reviews (1) · Last reviewed commit: "fix(node-sea): bound duplicate blob veri..." · Reviewed by Greptile |
Summary
Bound Node SEA duplicate-blob verification before hashing native payloads. A crafted Mach-O with eight overlapping section declarations makes a 17,135-byte file trigger 131,072 bytes of payload hashing and return a candidate location on main. Increasing the declaration count multiplies this work even when each blob satisfies the selected per-blob limit.
The shared
collapseRangesowner serves Mach-O, ELF and PE. It deduplicated exact ranges but had no aggregate hash-work allowance. This is distinct from merged #8031's ELF note-header scan bound; the reproduction uses Mach-O and reaches the later payload-hashing stage. The Deno sibling already enforces a carrier-size duplicate-verification allowance.Fix and boundaries
Reject unequal-length declarations as the existing conflicting-blob format failure before reading payloads. Preflight the total bytes of distinct ranges against the carrier file size, using the existing typed fixed-capacity failure and its no-runtime-override remediation. Exact aliases are still deduplicated; ordinary disjoint identical copies remain accepted.
One producing-owner fix covers all three native carrier paths. The owning guide documents the allowance. No schema, dependency, configurable limit, target execution, process lifecycle or timeout changes. This is an ordinary resource-bound correction in an existing passive parser; a new capability/scope decision is not applicable. No separate issue is linked because this focused fix includes the reproduction and public-boundary regression.
Reproduction and checks actually run
Base:
9c86465d47e98306e1ee1f77e7fb25d1d737b1db, latest main fetched again before commit.FileHandle.readbyte bound; unequal lengths unnecessarily read both payloads; the compiled publicinspect-artifactCLI reaches malformed-blob failure instead of the capacity refusal. Exact-alias and disjoint-copy controls pass.truncated/limit/capacity, fixed-allowance guidance, and unchanged source bytes. A subsequent Buffer comparison style correction passed the targeted CLI again; this is overlapping verification, not an additional distinct test count.npm run check:fast: passed (35.177 s).npm run docs:check, test discovery (3496 files exactly once), global format/Knip/metadata checks, architecture guards (2761 source files), and production reachability check passed.Verification limits: the overlapping fixture is an authored native carrier with zero-filled candidate blobs, not a runnable postject-produced executable. It deliberately reaches verification before blob decoding. Actual Linux file I/O and compiled CLI/MCP were exercised; native Windows/macOS/Bun and real Node SEA executable production/execution were not. Byte-read counts establish the work bound; no latency or memory benchmark improvement is claimed. Full
npm run check/check:prand the complete local suite were not run: all other global static components passed, while type-aware lint was scoped to changed files on this 8 GiB host. Hosted CI remains separate.Author readiness
Human owner: @ShuaixinHuang
Prepared with AI assistance. @ShuaixinHuang explicitly confirmed all three initial declarations after reviewing final commit
b0d8773ae10a0da7eb87fc5f5c08f41e3d39440cand the evidence/limits in this body. No previous PR's confirmation was reused.Resubmission
Re-submitted after closing the previous PR; source branch and validated change are unchanged.