Problem: verify-commits.py checks a Git commit's history for trusted signatures and tree hashes back to configured roots.
The documented workflow runs this check after fetching a commit and before checkout, proceeding only when the script succeeds.
A commit that is an ancestor of a configured root is intentionally accepted without checking earlier history.
The script also takes this success path after Git errors or for divergent commits, even though neither establishes that relationship.
Fix: Require Git to prove the ancestor relationship before taking this success path.
Reproducers: Each commit can be validated manually.
<details><summary>Manual reproducer: Git error</summary>
Run this on master and at this PR's head:
contrib/verify-commits/verify-commits.py 0000000000000000000000000000000000000000 && echo 🐛 || echo 🛡️
master exits successfully without verifying the missing commit, while the PR head rejects the Git error.
</details>
<details><summary>Manual reproducer: divergent history</summary>
On master and at this PR's head, create an unreferenced sibling of the trusted root and run the verifier:
root=$(head -n1 contrib/verify-commits/trusted-git-root)
divergent_commit=$(git commit-tree "$root^{tree}" -p "$root^" -m 'divergent commit')
contrib/verify-commits/verify-commits.py "$divergent_commit" && echo 🐛 || echo 🛡️
master exits successfully without verifying the sibling commit, while the PR head rejects divergent history.
</details>
This issue was also found and disclosed responsibly by the Red Team 🟥.