GHSA-cg6r-mpgc-h9mm

Suggest an improvement
Source
https://github.com/advisories/GHSA-cg6r-mpgc-h9mm
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-cg6r-mpgc-h9mm/GHSA-cg6r-mpgc-h9mm.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-cg6r-mpgc-h9mm
Aliases
Published
2026-10-15T18:05:19Z
Modified
2026-10-15T18:15:03Z
Severity
  • 3.3 (Low) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N CVSS Calculator
Summary
GitHub CLI partially discloses authentication tokens in `gh auth status` output
Details

Summary

A security vulnerability has been identified in GitHub CLI where gh auth status could potentially print a portion of the authentication token in plaintext, depending on the lexical structure of the token.

Affected users:

  • Authenticated users who 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/user access tokens (ghs_*, ghu_*, e.g., ghs_<APPID>_<JWT>), including the Actions GITHUB_TOKEN. Classic tokens such as gho_* and ghp_* have an underscore-free body and are not affected.

Details

The vulnerability stems from the way GitHub CLI masks the authentication token when reporting authentication state:

  1. A user runs gh auth status without --show-token, expecting the token to be fully masked.
  2. The masking logic redacts only the characters that follow the last underscore in the token, instead of redacting everything after the token prefix.
  3. The partially masked token is written to the command output, where it can be captured or shared.

Because gh auth status is a diagnostic command commonly run interactively and inside automated environments, the leaked token characters can end up in CI/CD job logs, terminal scrollback, screen recordings, screenshots, or pasted output shared in bug reports and support requests.

In v2.97.0, GitHub CLI fully masks the token in gh auth status output, preserving only the known token prefix and redacting the remainder unless --show-token is explicitly provided.

Impact

Running gh auth status in a context where the output is captured, logged, or shared could leak a portion of an affected token. The affected token types are fine-grained personal access tokens (github_pat_*) and GitHub App installation/user access tokens (ghs_*, ghu_*, e.g., ghs_<APPID>_<JWT>), including the Actions GITHUB_TOKEN. Installation and Actions tokens are short-lived, which narrows the window in which a recovered token could be reused. See GitHub credential types.

Remediation and Mitigation

  1. Upgrade gh to v2.97.0.
  2. Rotate any affected token whose masked gh auth status output may have been captured or shared:
  3. Until you can upgrade, avoid running gh auth status in contexts where the output is captured or shared, and manually redact the token line before sharing any output.
Database specific
{
    "cwe_ids":  [
        "CWE-201"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-10-15T18:05:19Z",
    "nvd_published_at":  "2026-08-06T22:18:13Z",
    "severity":  "LOW"
}
References

Affected packages

Go / github.com/cli/cli/v2

Package

Name
github.com/cli/cli/v2
View open source insights on deps.dev
Purl
pkg:golang/github.com/cli/cli/v2

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
2.97.0

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-cg6r-mpgc-h9mm/GHSA-cg6r-mpgc-h9mm.json"