Fix ghs_ token regex: rebuild lib/ bundle and add missing hyphen#3932
Open
hagould wants to merge 6 commits into
Open
Fix ghs_ token regex: rebuild lib/ bundle and add missing hyphen#3932hagould wants to merge 6 commits into
hagould wants to merge 6 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the artifact scanner to detect the newer ghs_ token formats and improves scanning to avoid duplicate findings when patterns overlap.
Changes:
- Broadened
ghs_regex patterns to match newer token formats. - Changed token scanning to iterate matches via
matchAll()and de-duplicate findings by match index. - Updated tests to cover the new
ghs_format and adjust expected token classification.
Show a summary per file
| File | Description |
|---|---|
| src/artifact-scanner.ts | Updates ghs_ detection patterns and revises scanning logic to use matchAll() with de-duping. |
| src/artifact-scanner.test.ts | Adds test coverage for the new ghs_ format and updates expected token types. |
| lib/entry-points.js | Compiled/bundled output reflecting the source changes. |
Copilot's findings
- Files reviewed: 2/3 changed files
- Comments generated: 7
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.
Updates the ghs_ token regex to support the new token format which allows dots and underscores ([A-Za-z0-9._-]) and variable length (no longer fixed at 36 chars).
See the changelog: https://github.blog/changelog/2026-05-15-github-app-installation-tokens-per-request-override-header/
Tracking in Slack: #tmp-stateless-app-tokens
Part of: https://github.com/github/authentication/issues/5980
Supersedes #3931 (from fork, had the correct source but stale bundle).
Fixes the compiled
lib/entry-points.jsbundle which was missing the-(hyphen) character in theghs_token regex character class.The source
.tsfile correctly uses[A-Za-z0-9._-]but the committed bundle had[A-Za-z0-9._]— missing the hyphen that base64url encoding (RFC 4648 §5) uses in JWT signatures. This is the same bug class as CVE-2026-45793 (Composer token leak).This PR rebuilds the bundle from the source to fix the mismatch.
Part of: github/authentication#6826