Repository navigation
fix(skills): catch stateless ghs_ tokens in the secret tripwire - #1177
Merged
Merged
Conversation
GitHub App installation tokens (including GITHUB_TOKEN in Actions) now
use the stateless format ghs_<appid>_<jwt>. The tripwire class
gh[pousr]_[A-Za-z0-9]{20} stops at the underscore after the app id, so
these tokens slipped past it. Allow "_" in the class so both the old
40-char tokens and the new stateless tokens are blocked.
Only the character class changes; line counts are unchanged.
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.
What changed
The secret tripwire regex in the email-sending skills now allows
_after the GitHub token prefix:gh[pousr]_[A-Za-z0-9]{20}->gh[pousr]_[A-Za-z0-9_]{20}Only that character class changes. No lines are added or removed, so line numbers stay the same and no catalog regen is needed.
Why
GitHub App installation tokens, including
GITHUB_TOKENin Actions, now use the stateless formatghs_<appid>_<jwt>(GitHub changelog, Oct 2 2026: "Stateless GitHub App installation tokens rolled out"). The old class stopped at the underscore after the app id, so these tokens were not caught and could be sent out in an email body.How tested
Ran the new pattern with
grep -qEand Pythonre:ghs_1234567_eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...sig-_xghp_tokenghp_short