Repository navigation
fix(windows): reject native addons with unusable delay-import tables - #14057
Closed
ShuaixinHuang wants to merge 2 commits into
Closed
ShuaixinHuang wants to merge 2 commits into
ShuaixinHuang wants to merge 2 commits into
Conversation
Contributor
[Medium impact] The PR appears safe to merge within its stated scope of rejecting the two reported Windows artifact layouts. SummaryAdds Windows native build and artifact checks that reject missing delay-import directories and IAT addresses outside writable, file-backed PE sections.
Reviews (1) · Last reviewed commit: "fix(windows): use shared PE readers in d..." · Reviewed by Greptile |
ShuaixinHuang
marked this pull request as ready for review
November 23, 2026 12:18
ShuaixinHuang
requested review from
N0zoM1z0,
gensokyo-dev,
kaoru0822-kitauji and
morluto
as code owners
November 23, 2026 12:18
Codex Review Summary: ✅ CompletedThis 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. |
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fail the Windows native build and artifact verification when the cross-linker emits no delay-import directory or puts a delay-import address table in read-only PE data. These layouts previously passed identity verification even though the reported Debian build crashed at its first Node-API call.
Problem and expected behavior
The report records a write access violation at the delay IAT RVA on Windows Server 2025. The failing Debian 13 output had an empty delay-import data-directory entry and a read-only IAT section. The published Ubuntu build had a declared directory and writable IAT section. Report and fault evidence
Change and scope
Reuse the COFF, optional-header, and section readers to find the delay directory and check each descriptor's IAT RVA against a file-backed writable section. Run the check immediately after linking and in the artifact verification command, which also checks restored artifacts. Include the PE header readers in the Windows build cache key.
Contract and boundary impact
Evidence and regression coverage
[email protected]addon passed locally. Clearing write permission on the containing PE section and recalculating the digest passed the identity checks but failed the new check. Clearing the directory entry also failed the new check.Validation performed
node scripts/run-typescript.mjs -p tsconfig.build.jsonpassed.vitest run src/domain/windowsNativeArtifact.test.ts tests/boundary/process/windowsNativeArtifactVerifier.test.tspassed all 31 tests.git diff --checkpassed.Compatibility, safety, and release
No migration or ABI change. Local builders whose toolchain emits either unusable layout now fail with a diagnostic. The verifier reads build output without loading or executing it.
Supersedes #12756.
Author readiness
Human owner: @ShuaixinHuang