GitHub CLI, Token Leakage, CVE-2026-64652 (Medium) -DC-Oct2026-3238

Listen to this Post

The vulnerability resides in the core diagnostic command processing engine of the GitHub CLI, specifically within the output formatting logic used by `gh auth status` when evaluating and reporting active user authentication states. When a user executes `gh auth status` without supplying the explicit `–show-token` flag, the utility intends to suppress raw secret exposure by printing a masked representation of the active credential. However, a fundamental lexical flaw in how string slicing handles token structures causes the sanitization routine to anchor its redaction index to the final underscore character found within the token body rather than stripping everything following the recognized token prefix. Modern token formats such as fine-grained personal access tokens (github_pat_) and GitHub App installation or user access tokens (ghs_, ghu_, including complex payloads like ghs_<APPID>_<JWT>) contain multiple internal lexical segments separated by underscores. Because the masking mechanism only strips characters residing after the final trailing underscore, a substantial portion of the intermediate payload text remains fully exposed in plaintext directly inside the command line output feed. Because `gh auth status` is heavily integrated into interactive developer workflows, continuous integration pipelines, and automated test environments, this unmasked residual text frequently propagates into persistent CI/CD job logs, local terminal scrollback history, automated screen recordings, and debugging bug reports shared publicly or with support teams. Consequently, unauthorized actors or automated log-scraping services can extract these plaintext fragments to reconstruct partial credential secrets, potentially abusing short-lived installation access tokens or leveraging leaked components before expiration. Remediation requires upgrading the command line tool package to version 2.97.0 or higher, where the output formatter correctly preserves only the designated prefix and redacts all subsequent bytes by default.

DailyCVE Form:

Platform: GitHub CLI
Version: Prior to 2.97.0
Vulnerability: Token Information Disclosure
Severity: Medium
Date: July 30, 2026

Prediction: August 15, 2026

What Undercode Say

The underlying defect stems from an overly simplistic string manipulation error where the masking algorithm computes the slice boundary using `strings.LastIndex` looking for an underscore instead of truncating immediately after the designated token prefix. This means any token format containing internal segment dividers preserves the characters between the prefix boundary and the final underscore in cleartext view.

Analytics

Check vulnerable GitHub CLI version
gh --version
Run diagnostic command that triggers partial token leakage on vulnerable versions
gh auth status
Verify patched behavior where the entire body following the prefix is fully redacted
gh auth status --show-token
// Flawed masking pattern representation from earlier versions
func maskToken(token string) string {
idx := strings.LastIndex(token, "_")
if idx == -1 {
return ""
}
return token[:idx+1] + strings.Repeat("", len(token)-idx-1)
}

Exploit: (Educational Purposes!)

Simulate capturing leaked token segments from automated CI log outputs
gh auth status | grep -E "github_pat_|ghs_|ghu_" > leaked_tokens.txt
Parse exposed intermediate token fragments for analysis
cat leaked_tokens.txt

Protection: from this CVE

Upgrade the GitHub CLI utility immediately to version 2.97.0 or later to enforce strict token masking. Avoid executing diagnostic commands in environments where output streams are archived or logged until upgrades are complete, and proactively rotate any fine-grained personal access tokens whose diagnostics were previously captured.

Impact

Running diagnostic commands in environments where outputs are logged, recorded, or shared can expose token fragments belonging to fine-grained personal access tokens and application access credentials. This compromise can allow unauthorized third parties to hijack active sessions, read repository contents, or interact with automated workflows during the validity window of the exposed tokens.

🎯Let’s Practice Exploiting & Learn Patching For Free:

🎓 Live Courses & Certifications:

Join Undercode Academy for Verified Certifications

🚀 Request a Custom Project:

Secure, high-velocity infrastructure and disruptive technological engineering. Contact our engineering team for high-tier development and proprietary systems:
[email protected]
💎 Smart Architecture | 🛡️ Secure by Design | ⭐ Trusted by Thousands

Sources:

Reported By: github.com
Extra Source Hub:
Undercode

🔐JOIN OUR CYBER WORLD [ CVE News • HackMonitor • UndercodeNews ]

💬 Whatsapp | 💬 Telegram

📢 Follow DailyCVE & Stay Tuned:

𝕏 formerly Twitter 🐦 | @ Threads | 🔗 Linkedin Featured Image

Scroll to Top