Skip to content

ci: a fork can no longer take the judge-change exemption - #2144

Merged
The01Geek merged 1 commit into
mainfrom
policy-update/fork-bypass-fix
Aug 29, 2026
Merged

ci: a fork can no longer take the judge-change exemption#2144
The01Geek merged 1 commit into
mainfrom
policy-update/fork-bypass-fix

Conversation

@The01Geek

Copy link
Copy Markdown
Owner

A policy-update change: it modifies the release verifier and its workflow, so it lands on its own and is judged by the verifier currently on main.

The bug

The exemption that lets a maintainer change the verifier keyed on the branch name:

case "$HEAD_REF" in
  policy-update/*) exit 0 ;;
esac

HEAD_REF is github.event.pull_request.head.ref — and a fork chooses its own branch names. A pull request from a fork on a branch called policy-update/anything skipped the judge comparison and then skipped artifact verification, reporting the required check green on a tree that was never verified.

With required_approving_review_count: 0, nothing automated stood between such a pull request and a merge. The workflow's own header comment — "a PR cannot edit the judge that evaluates it" — was not true as written.

The fix

Every exemption is now gated on an identity the head cannot forge:

IS_SAME_REPO: ${{ github.event.pull_request.head.repo.full_name == github.repository }}

A fork always takes the strict path — judge comparison enforced, artifact verification enforced.

Also

The private repository's name was published verbatim in the verifier's own leak pattern — the single control built to keep that string out of the release. It did not self-trip only because the character preceding it is the b of \b. It is now assembled from fragments, as the allowlist keys already were, and still detects a real occurrence.

The exemption that lets a maintainer change the release verifier keyed on the
branch NAME. A fork chooses its own branch names, so a pull request from a fork
on a branch called policy-update/... skipped both the judge comparison and the
artifact verification, and reported the required check green on a tree that had
never been verified. With no approving review required, nothing automated stood
between such a pull request and a merge.

Every exemption is now gated on the pull request originating in this repository
(head.repo.full_name == github.repository), which the head cannot forge. A fork
always takes the strict path.

Also refragments the private repository's name in the verifier's leak pattern.
It was published verbatim in the one control built to keep it out of the release,
and did not self-trip only because the character preceding it is the b of \b.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@The01Geek
The01Geek merged commit 9cd8769 into main Aug 29, 2026
1 check passed
@The01Geek
The01Geek deleted the policy-update/fork-bypass-fix branch August 29, 2026 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant