Repository navigation
Reject certificate tables whose declared bytes are absent - #4664
Open
rudycelekli wants to merge 2 commits into
Open
rudycelekli wants to merge 2 commits into
rudycelekli wants to merge 2 commits into
Conversation
worktrunk-bot
left a comment
Collaborator
There was a problem hiding this comment.
The new regression tests are only run by the manual unittest discover command. The repository's CI and pre-merge commands do not invoke .github/tests, so a later change could restore the false-green certificate check while PR checks still pass. Please run this suite in a PR CI job so the regression cases protect the checker continuously.
rudycelekli
marked this pull request as ready for review
November 2, 2026 14:43
worktrunk-bot
approved these changes
Nov 2, 2026
This branch has not been deployed
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.
The Windows release checker currently treats a nonzero certificate-table size as proof that the table is present, ignoring its file offset. A table entry with offset zero or a range extending beyond EOF can therefore produce
all executables signedeven though its declared certificate bytes are absent.Check that the entry has a nonzero file offset and that its entire declared range fits inside the executable before reporting a nonzero table size. This remains a certificate-table presence check; it does not validate Authenticode signatures, trust chains, PE structure, or certificate contents.
Validation:
python3 -m unittest discover -s .github/tests -vpasses two methods covering 10 PE32/PE32+ fixture cases via the actual checker subprocess over ZIP archives. Six invalid fixture cases are accepted by the unchanged upstream script and rejected with the fix. The accepted fixtures contain synthetic certificate bytes and establish only range-presence behavior.Hosted validation at exact head
69b18a2bfe4296ff5abbfcad76039d817f018d23: the required Linux, macOS, Windows, and fast-check jobs passed (17 successful check runs, 20 skipped; pre-commit.ci also successful). The localcargo run -- hook pre-merge --yeshook was not validated in the minimal checkout. Focused Python checker tests passed locally as described above. This remains a certificate-table byte-presence check, not signature or trust validation.AI disclosure: implementation, regression tests, and this description were prepared with Codex and reviewed by a separate Codex agent. No human-authorship or human-review claim is made.
Review follow-up: run
.github/testswith standard-library unittest discovery in the required PRfast-checksjob, immediately after checkout. This makes the checker regressions continuous; workflow triggers, permissions, environment gates, and other steps are unchanged. The exact CI command passes locally (2 methods / 10 fixture cases), and PyYAML 6.0.3 validates the workflow. Hosted checks for the new head are pending; the successful hosted results above refer to the explicitly named earlier head.