Skip to content

fix(pe): reject misaligned certificate table offsets - #9276

Merged
morluto merged 3 commits into
morluto:mainfrom
ShuaixinHuang:codex/pe-certificate-table-offset
Nov 7, 2026
Merged

morluto merged 3 commits into
morluto:mainfrom
ShuaixinHuang:codex/pe-certificate-table-offset

Conversation

@ShuaixinHuang

Copy link
Copy Markdown
Contributor

Summary

PE signing inspection rounded entry offsets relative to the table but accepted a misaligned table start. Moving an otherwise unchanged certificate table from file offset 0x200 to 0x201 still produced a complete report. Reject misaligned table starts before decoding entries, as required by the PE attribute certificate table layout.

The existing parser owns the rejection and the shared format-error path serves CLI and MCP. No signature verification, input or output schema, or provider capability change.

Validation

The PE32 and PE32+ regressions failed on main 8eff65127. Both now reject the shifted table and still parse their aligned controls. All 54 certificate parser tests passed. Targeted formatting and whitespace checks passed. Lint reported parser complexity and length advisories. No live signature verification or CLI/MCP end-to-end run.

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.

@greptile-apps

greptile-apps Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable defects were found.

Summary

Rejects certificate tables whose file offsets are not aligned to eight bytes, before decoding any entries.

  • PE certificate inspection rejects tables that start at misaligned file offsets.
  • The MCP test expects the current wording about unchanged executable bytes.

Reviews (1) · Last reviewed commit: "style: format ghidra limitation assertio..." · Reviewed by Greptile

@ShuaixinHuang
ShuaixinHuang marked this pull request as ready for review November 7, 2026 12:37
@chatgpt-codex-connector

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-07T12:39:30.775427Z 7bd7ee7 Draft marked ready
ℹ️ 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.

@morluto
morluto merged commit 8842092 into morluto:main Nov 7, 2026
95 of 97 checks passed
@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