{"id":"GHSA-cg6r-mpgc-h9mm","summary":"GitHub CLI partially discloses authentication tokens in `gh auth status` output","details":"### Summary\n\nA 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.\n\nAffected users:\n- 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_\u003cAPPID\u003e_\u003cJWT\u003e`), including the Actions `GITHUB_TOKEN`. Classic tokens such as `gho_*` and `ghp_*` have an underscore-free body and are not affected.\n\n### Details\n\nThe vulnerability stems from the way GitHub CLI masks the authentication token when reporting authentication state:\n\n1. A user runs `gh auth status` without `--show-token`, expecting the token to be fully masked.\n2. The masking logic redacts only the characters that follow the last underscore in the token, instead of redacting everything after the token prefix.\n3. The partially masked token is written to the command output, where it can be captured or shared.\n\nBecause `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.\n\nIn `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.\n\n### Impact\n\nRunning `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_\u003cAPPID\u003e_\u003cJWT\u003e`), 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](https://docs.github.com/en/organizations/managing-programmatic-access-to-your-organization/github-credential-types#credential-types-overview).\n\n### Remediation and Mitigation\n\n1. Upgrade `gh` to `v2.97.0`.\n2. Rotate any affected token whose masked `gh auth status` output may have been captured or shared:\n   - **Fine-grained personal access tokens (`github_pat_*`):** regenerate the token from your account settings. See [Managing your personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens).\n   - **GitHub App installation/user access tokens (`ghs_*`, `ghu_*`, e.g., `ghs_\u003cAPPID\u003e_\u003cJWT\u003e`):** these are short-lived and rotate automatically (See [GitHub credential types](https://docs.github.com/en/organizations/managing-programmatic-access-to-your-organization/github-credential-types#credential-types-overview)). If you believe a token was captured while still valid, you can revoke it immediately using the [Revoke an installation access token](https://docs.github.com/en/rest/apps/installations#revoke-an-installation-access-token) REST endpoint (`DELETE /installation/token`). To cut off a third-party app's access more broadly, suspend or uninstall the app from the web UI. See [Reviewing and modifying installed GitHub Apps](https://docs.github.com/en/apps/using-github-apps/reviewing-and-modifying-installed-github-apps).\n   - **Actions `GITHUB_TOKEN`:** this token is automatically invalidated when the job finishes, so no manual revocation is normally required. See [GitHub credential types](https://docs.github.com/en/organizations/managing-programmatic-access-to-your-organization/github-credential-types#credential-types-overview).\n3. 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.","aliases":["CVE-2026-64652"],"modified":"2026-10-15T18:15:03.454517744Z","published":"2026-10-15T18:05:19Z","database_specific":{"github_reviewed_at":"2026-10-15T18:05:19Z","nvd_published_at":"2026-08-06T22:18:13Z","cwe_ids":["CWE-201"],"severity":"LOW","github_reviewed":true},"references":[{"type":"WEB","url":"https://github.com/cli/cli/security/advisories/GHSA-cg6r-mpgc-h9mm"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-64652"},{"type":"WEB","url":"https://github.com/cli/cli/commit/3f6a16a9f8c7fe9676aa8d8f47b399310dd231c3"},{"type":"PACKAGE","url":"https://github.com/cli/cli"},{"type":"WEB","url":"https://github.com/cli/cli/releases/tag/v2.97.0"}],"affected":[{"package":{"name":"github.com/cli/cli/v2","ecosystem":"Go","purl":"pkg:golang/github.com/cli/cli/v2"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"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"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N"}]}