Harden /capabilities: authorization + same-repo + exit handling - #63
Merged
Conversation
- authorize job: commenter must be OWNER/MEMBER/COLLABORATOR (unspoofable author_association) and the PR must be same-repo (no fork code run with the write token) — addresses the two P1 security findings. - handle apply exit 1 (structural) as a red failure with a comment; soften unknown-capability (exit 3) to a green run with a rejection comment. - least privilege: read-only default token; only the capabilities job gets write.
madhuchavva
force-pushed
the
harden/capabilities-authz
branch
from
August 12, 2026 20:59
31646aa to
ce1daf8
Compare
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.
Addresses the three Greptile P1 findings (all verified legitimate against the code):
authorizejob: commenter must be OWNER/MEMBER/COLLABORATOR (author_association, unspoofable, no token-permission needed).isCrossRepository), so fork code is never run with the write token. Same-reposdk-version/*branches require write access to push, so the residual is insider-only. Least-privilege: default token is read-only; only thecapabilitiesjob gets write.1now fails the run (red) with a comment; unknown-capability (exit3) is softened to a green run + rejection comment.Merge to main and I'll re-run a
/capabilitiesto confirm the authz gate passes for a trusted commenter and the flow still works end-to-end.Same hardening applied to the main-app PR growthbook/growthbook#6626.