Skip to content

fix(windows): reject descending numeric PE resource IDs - #10371

Closed
wunianze666-netizen wants to merge 1 commit into
morluto:mainfrom
wunianze666-netizen:codex/pe-resource-numeric-order
Closed

wunianze666-netizen wants to merge 1 commit into
morluto:mainfrom
wunianze666-netizen:codex/pe-resource-numeric-order

Conversation

@wunianze666-netizen

Copy link
Copy Markdown
Contributor

Summary

Reject descending numeric IDs in a PE resource directory instead of reporting a complete inventory.

Problem and expected behavior

A PE32 or PE32+ resource name table containing ID 9 followed by ID 4 passes the current parser and reports complete coverage. The PE format specifies ascending numeric order within the ID entries of each table. PE Resource Directory Entries

Change and scope

Check numeric order in the full PE resource traversal. Preserve the existing duplicate-identity check and keep the original row order for valid files. The separate named-carrier probe and name collation are outside this change.

Follow the contribution scope.
Unresolved scope, authority, side effects, or required verification block
integration. Link the required maintainer scope decision for new providers or
capabilities involving target execution, injection, mutation, or protection
recovery; ordinary fixes within existing boundaries may state "not applicable".
Draft PRs may leave the scope decision pending and the readiness and merge checklists
unchecked. Maintainers can help resolve open questions.

Contract and boundary impact

  • The PE resource parser checks the order of already decoded numeric identities before following their targets.
  • A descending numeric ID uses the existing malformed-format outcome through the CLI and MCP. The named tool schema and valid artifact report are unchanged.
  • The parser preserves original numeric IDs, source ranges, artifact SHA-256, and the current entry and metadata budgets.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • On frozen main bbe2bcc, both descending inputs returned exit 0 and a complete report. The same PE32 and PE32+ bytes now return invalid_request with an invalid_format issue. Each valid ordered control retains its full normalized report.
  • Targeted tests exercise each PE width, the ordered control, and the malformed order. The production CLI and named MCP SDK cover the error boundary and close the SDK session.
  • Validation used synthetic files and offline inspection on Windows. Windows loader behavior and third-party files were outside the comparison.

For boundary fixes, identify the applicable boundary regressions
and lifecycle regressions
covered by the evidence above, and explain relevant gaps.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • Two targeted tests failed on main and passed on the candidate. All 81 focused parser, provider, and service tests passed.
  • The compiled CLI and production MCP SDK each inspected the same four files on both revisions. Checked the named ToolDefinition, JSON Schema 2020-12, typed error parity, and identical valid reports.
  • Build, formatting, Git diff checks and normal commit and pre-push checks passed.

Compatibility, safety, and release

  • Files with descending numeric resource IDs now receive the existing format error. Valid files keep their results and original numeric identities.
  • Windows x64 and Node 24.22.1 were used for offline inspection.

Author readiness

Human owner: @wunianze666-netizen

  • 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.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T14:12:41.573775Z aa4ba12 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.

@greptile-apps

greptile-apps Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The reviewed changes appear safe to merge.

Summary

The PR rejects descending numeric IDs during full PE resource traversal.

  • PE resource inspection rejects descending numeric IDs.

No actionable code or security issues were found. Tests were inspected but not run. Whether this PR has been superseded could not be checked because GitHub access required authentication.

Reviews (1) · Last reviewed commit: "fix(windows): reject descending numeric ..." · Reviewed by Greptile

@morluto

morluto commented Nov 19, 2026

Copy link
Copy Markdown
Owner

The full PE resource traversal now rejects descending numeric sibling IDs in #12156, with PE32 and PE32+ coverage. The merged change preserves valid traversal order and the duplicate identity check. Closing this superseded implementation.

@morluto morluto closed this Nov 19, 2026
@morluto morluto added area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior 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: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants