Skip to content

fix(node-sea): bound duplicate blob verification work - #11736

Merged
morluto merged 19 commits into
morluto:mainfrom
ShuaixinHuang:review/ci-repair-11215
Nov 19, 2026
Merged

morluto merged 19 commits into
morluto:mainfrom
ShuaixinHuang:review/ci-repair-11215

Conversation

@ShuaixinHuang

@ShuaixinHuang ShuaixinHuang commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

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 collapseRanges owner 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.

Resubmission and prerequisites

Replaces #11215 at the human owner's request after repairing its inherited CI failures. Bound cumulative duplicate Node SEA blob verification work. The original feature commits are preserved; prior review and baseline reproduction evidence remain available in #11215.

Qualified head 29c3e4162 incorporates main 552d1c710, including the merged shared CI repair #11727. It also explicitly includes the missing-installation JVM-probe repair #11732; that prerequisite requires review. The new comparison drops the shared fixes already accepted upstream.

The Node SEA allowance error is migrated to the current shared resource entry point and typed work-allowance facts, preserving its original carrier-byte work bound and acceptance controls.

Executed validation

Linux, Node 24.22.1 / npm 11.9.0:

  • npm run test:focused -- src/artifacts/nodeSea/NodeSeaHashWork.test.ts tests/boundary/cli/nodeSeaHashWork.test.ts — Test Files 2 passed (2); Tests 5 passed (5); required build passed.
  • npm run check:fast, normal commit/pre-push hooks, and git diff --check passed.
  • Merging the latest main changed ancestry only; the qualified source tree was identical.
  • fix(ghidra): avoid Java probes for missing installations #11732 separately passed 129 Ghidra/historical-summary tests (1 platform skip). The merged shared repair passed 101 tests (9 platform skips) and 148 real mitmproxy cases.

Hosted CI is running for this replacement. Native Windows/macOS and the complete monolithic suite were not run locally. Checked-in independent producer witnesses were exercised by the selected tests; producer generation was not rerun unless named above.

Author readiness

Human owner: @ShuaixinHuang

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

The initial readiness declaration is carried from #11215; the repository permits later corrective pushes without a new initial declaration.

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 without this bound. Increasing the declaration count multiplies this work even when each blob satisfies the selected per-blob limit.

The shared collapseRanges owner 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.

Change and scope

Replaces #11215. Head 2257f126c is a merge of current main (6a5d77bf2) plus the Node SEA bound.

NodeSeaLocation.ts keeps main's reader, including the Mach-O segment admission from #12156, #12193, #12263, and #12288, and adds this PR's carrier-byte duplicate-verification bound. Unequal lengths still fail as a format error before hashing. Overlapping equal-length copies whose total hashed bytes exceed the carrier file size fail with the fixed work allowance (reason: "limit", boundary: "capacity").

The Ghidra absent-installation hunks duplicated merged #11732. The merge had reapplied that test beside the copy already on main; that duplicate is removed. The diff against main does not touch GhidraInstallation.

The public CLI regression asserts code: "truncated" and details.reason / details.boundary. It does not check stdout prose.

Contribution scope: ordinary fix inside the existing Node SEA reader. A new provider or target-execution capability is not applicable.

Validation performed

Linux, Node 22.23.4 / npm 11.16.0. Engines allow ^22.23.4. .nvmrc pins 24.22.1; that exact build was not the Node used here.

  • oxfmt on the touched Node SEA sources, tests, and docs — no further edits.
  • npm run test:focused -- src/artifacts/nodeSea/NodeSeaHashWork.test.ts tests/boundary/cli/nodeSeaHashWork.test.ts — Test Files 2 passed (2); Tests 5 passed (5). The required build passed.
  • npm run check:fast — typecheck, lint, and architecture guards passed. The pre-push hook ran the same check from cache.

Native Windows/macOS and the complete suite were not run. The selected tests exercised the checked-in fixtures; producer generation was not rerun.

Author readiness

Human owner: @ShuaixinHuang

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

The initial readiness declaration is carried from #11215; the repository permits later corrective pushes without a new initial declaration.

Open in Web Open in Cursor 

ShuaixinHuang and others added 16 commits November 13, 2026 03:54
…file

The Windows-only case at `clientConfigurationEnvironment.test.ts:226` wrote
`rea_mcp_input_schema_profile: "full"`. That profile was retired: the reader
now refuses it ("REA_MCP_INPUT_SCHEMA_PROFILE accepts only \"compact\" …"),
so `configureClientConfiguration` returned `failed/readback` before writing
and the case failed on every Windows run, including main's own
`Windows capability and package lane`.

The case has no Windows dependency — it passes an explicit `configPath` and
the Kimi write dialect is the same everywhere — so it now runs on every
platform, which is what let the stale value rot unnoticed. The fixture keeps
the lowercase explicit key the case is about, with the supported value.

Verified on `main` `d6bcfc10`: the same fixture driven through
`configureClientConfiguration(..., "win32")` on this host reproduced
`{"status":"failed","reason":"readback"}` with the retired value and now
returns `{"status":"configured"}` with `compact`. The file's 75 cases pass
here (66 run, 9 platform-conditioned skips) and `check:fast` passes.
…alue-11215

# Conflicts:
#	src/artifacts/nodeSea/NodeSeaLocation.ts
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-16T11:57:30.287707Z
We couldn’t complete this review. Comment @codex review to try again.
29c3e41 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@greptile-apps

greptile-apps Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Bounds duplicate Node SEA blob checks by the carrier file size before hashing starts.

  • Node SEA checks duplicate blobs within a carrier-sized work limit.

No actionable issues found. Tests were not rerun. The PR replaces #11215 according to its description; no newer replacement could be verified from the available context.

Reviews (2) · Last reviewed commit: "test(node-sea): assert duplicate-blob re..." · Reviewed by Greptile

Copy link
Copy Markdown
Contributor Author

@morluto Could you please review this PR when you have time? As the author, I am finding the ongoing work of keeping these pending branches synchronized and revalidated a substantial maintenance burden. The current head's CI has passed, there are no unresolved inline review threads, and the PR description records the evidence and remaining validation limits. If this change is outside the project's priorities or scope, a clear direction would also help me avoid further unnecessary maintenance. Thank you.

cursoragent and others added 3 commits November 19, 2026 15:38
Merging main reapplied the morluto#11732 case beside the copy already on main.

Co-authored-by: morluto <[email protected]>
The CLI coverage already checks the truncated code and limit details.

Co-authored-by: morluto <[email protected]>
@morluto
morluto merged commit 4491c84 into morluto:main Nov 19, 2026
40 checks passed
@morluto morluto added area: tests Test suite and verification bug Something isn't working labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: tests Test suite and verification bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants