Repository navigation
fix(windows): reject native addons with unusable delay-import tables - #12756
ShuaixinHuang wants to merge 2 commits into
Conversation
[Medium impact] The reviewed changes appear safe to merge. SummaryThe PR rejects Windows native addons with a missing delay-import directory or an IAT outside writable, file-backed PE data.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Linked or restored addon] --> B[Check PE identity]
B --> C[Read delay-import directory]
C --> D[Require one file-backed section]
D --> E[Check each descriptor's IAT section]
E --> F{Writable?}
F -->|Yes| G[Accept artifact]
F -->|No| H[Fail with linker diagnostic]
Reviews (2) · Last reviewed commit: "fix(windows): use shared PE readers in d..." · Reviewed by Greptile |
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. |
|
Hi @morluto @kaoru0822-kitauji @N0zoM1z0 @gensokyo-dev @vincentkoc, When a maintainer has time, could you review this PR at GitHub is still rejecting my attempts to open new upstream PRs. I can continue updating existing branches and addressing review feedback. |
* test(ida): consolidate worker release and retry checks * test(ida): point lifecycle coverage at retained cleanup checks
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.
Author readiness
Human owner: @ShuaixinHuang