Skip to content

fix(auth): allowlist the gh runner to read-only commands (isolation by construction)#112

Merged
stuffbucket merged 1 commit into
mainfrom
fix/gh-runner-readonly-allowlist
Jun 11, 2026
Merged

fix(auth): allowlist the gh runner to read-only commands (isolation by construction)#112
stuffbucket merged 1 commit into
mainfrom
fix/gh-runner-readonly-allowlist

Conversation

@stuffbucket

Copy link
Copy Markdown
Owner

Locks in your requirement: maximal sign-in/out/switch must have no effect on what gh is signed into, on gh, on browser GitHub sessions, or on Copilot-CLI account selection.

Two fanned-out audits confirmed maximal is ISOLATED today — every gh call is read-only (gh --version, auth status, auth token), no mutating gh command exists anywhere, sign-out unlinks only maximal's own token copy (so gh stays signed in), the only browser URL is the additive device-grant, and maximal's OAuth client_id is distinct from gh's. The audits' one recommendation was to make it isolated by construction, not just by convention.

This change

isReadOnlyGhArgs() + a reject in the gh runner: it will only ever execute --version, auth status, or auth token. Anything else (auth login/logout/switch/refresh/setup-git, config set, api -X POST, …) is refused before exec. So no future caller can make maximal mutate gh state.

+tests asserting the mutating/unknown commands are all rejected and the three read-only ones allowed. Full suite green (819); check:fast + knip clean.

(Part of the auth-isolation work alongside the guard-timers #110 and the busybar #111.)

…y construction)

maximal must never affect what gh is signed into / any gh state. Today every
gh invocation IS read-only (gh --version, auth status, auth token), but the
runner would execute ANY args handed to it — a future caller could slip in a
mutating command. Add isReadOnlyGhArgs() and reject in defaultRunner anything
that isn't --version / auth status / auth token, turning the prose contract
into an enforced gate. +tests asserting login/logout/switch/refresh/setup-git/
config-set/api-POST are all rejected.

Confirms the isolation audit verdict (maximal only READS gh, stores its own
token copy, sign-out deletes only that copy) and locks it in.
@stuffbucket stuffbucket merged commit 6294ff7 into main Jun 11, 2026
4 checks passed
@stuffbucket stuffbucket deleted the fix/gh-runner-readonly-allowlist branch June 11, 2026 02:42
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