Severity by source
AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N
Local vector because exposure requires captured output; PR:L because authenticated gh user is required; C:L for partial token segment disclosure only.
Primary rating from Vendor (github).
CVSS VectorVendor: github
Lifecycle Timeline
4DescriptionCVE.org
GitHub CLI (gh) is GitHub's official command line tool. Prior to version 2.97.0, gh auth status masked only the characters after the last underscore in certain fine-grained personal access tokens and GitHub App tokens. As a result, part of an affected token could appear in terminal or CI output that is captured or shared. Authenticated users are affected if they ran gh auth status (without the --show-token flag) with a token type whose format contains an underscore after the prefix. This includes fine-grained personal access tokens (github_pat_*) and GitHub App installation and user access tokens (ghs_*, ghu_*; for example, ghs_<APPID>_<JWT>), as well as the Actions GITHUB_TOKEN. Classic tokens such as gho_* and ghp_* have an underscore-free body and are not affected. This issue is fixed in version 2.97.0.
AnalysisAI
GitHub CLI's gh auth status command in versions prior to 2.97.0 partially exposed fine-grained personal access tokens and GitHub App tokens in terminal and CI output due to a flawed masking algorithm. The defect used strings.LastIndexByte to find the last underscore as the masking boundary - for tokens like github_pat_APPID_secretbody or ghs_APPID_JWT, this left the middle segment (between the type prefix and the last underscore) visible in plain text. Affected token types include fine-grained PATs (github_pat_*), GitHub App installation tokens (ghs_*), user access tokens (ghu_*), and the Actions GITHUB_TOKEN; classic tokens (gho_*, ghp_*) are not affected. No public exploit is identified at time of analysis.
Technical ContextAI
The root cause is CWE-201 (Insertion of Sensitive Information into Sent Data). The maskToken function in pkg/cmd/auth/status/status.go applied strings.LastIndexByte(token, '_') to locate the prefix boundary, then masked only what followed the final underscore. GitHub's fine-grained and App token formats embed an application identifier or structured segment before the secret body, delimited by underscores - e.g., github_pat_<APPID>_<secret> and ghs_<APPID>_<JWT>. The algorithm therefore treated the embedded APPID segment as part of the unmasked prefix. The fix, committed in https://github.com/cli/cli/commit/3f6a16a9f8c7fe9676aa8d8f47b399310dd231c3, replaces this logic with a prefix-allowlist (knownTokenPrefixes: github_pat_, ghp_, gho_, ghu_, ghs_, ghr_) that correctly masks all characters after the known structural prefix, regardless of internal underscores. Affected product confirmed as cli < 2.97.0 per EUVD-2026-54212.
RemediationAI
Upgrade GitHub CLI to version 2.97.0 or later, available at https://github.com/cli/cli/releases/tag/v2.97.0; this is the vendor-confirmed fix that replaces the flawed masking logic with a prefix-allowlist approach. As a precautionary measure regardless of upgrade status, rotate any fine-grained PATs, GitHub App installation tokens (ghs_*), user access tokens (ghu_*), or Actions repository secrets (GITHUB_TOKEN configurations) that may have been exposed through gh auth status output in shared CI logs, log aggregators, or terminal recordings. To mitigate risk before patching, avoid running gh auth status in CI pipelines or environments with log retention policies that allow third-party access; note that omitting the --show-token flag does not fully protect affected token types in vulnerable versions. The fix commit is at https://github.com/cli/cli/commit/3f6a16a9f8c7fe9676aa8d8f47b399310dd231c3 and the security advisory at https://github.com/cli/cli/security/advisories/GHSA-cg6r-mpgc-h9mm.
Same technique Information Disclosure
View allShare
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-54212