Recursive repository cloning can leak authentication tokens to non-GitHub submodule hosts in the gh cli
Key facts
- Attack vector
- Local
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- High
- Impact type
- Information disclosure
- Confidentiality · integrity · availability
- High · High · Low
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-200.
Summary
The gh cli is GitHub’s official command line tool. A security vulnerability has been identified in the GitHub CLI that could leak authentication tokens when cloning repositories containing `git` submodules hosted outside of GitHub.com and ghe.com. This vulnerability stems from several `gh` commands used to clone a repository with submodules from a non-GitHub host including `gh repo clone`, `gh repo fork`, and `gh pr checkout`. These GitHub CLI commands invoke git with instructions to retrieve authentication tokens using the `credential.helper` configuration variable for any host encountered. Prior to version `2.63.0`, hosts other than GitHub.com and ghe.com are treated as GitHub Enterprise Server hosts and have tokens sourced from the following environment variables before falling back to host-specific tokens stored within system-specific secured storage: 1. `GITHUB_ENTERPRISE_TOKEN`, 2. `GH_ENTERPRISE_TOKEN` and 3. `GITHUB_TOKEN` when the `CODESPACES` environment variable is set. The result being `git` sending authentication tokens when cloning submodules. In version `2.63.0`, these GitHub CLI commands will limit the hosts for which `gh` acts as a credential helper to source authentication tokens. Additionally, `GITHUB_TOKEN` will only be used for GitHub.com and ghe.com. Users are advised to upgrade. Additionally users are advised to revoke authentication tokens used with the GitHub CLI and to review their personal security log and any relevant audit logs for actions associated with their account or enterprise
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| cli | cli | before 2.63.0 | 2.63.0 | Patch available | CNA |
| — | github.com/cli/cli/v2 (Go) | before 2.63.0 | 2.63.0 | Patch available | GHSA-jwcm-9g39-pmcw |
- cli Vendorcli Affected before 2.63.0 Fixed in 2.63.0 Patch available CNA
- github.com/cli/cli/v2 (Go) Vendor— Affected before 2.63.0 Fixed in 2.63.0 Patch available GHSA-jwcm-9g39-pmcw
Remediation
- Fix · CNA cli (cli) Fixed in 2.63.0
- Fix · GHSA-jwcm-9g39-pmcw github.com/cli/cli/v2 (Go) Fixed in 2.63.0 Advisory →
Vendor assessments
Timeline
- 2026-10-02 Threatist record created from CVE-2024-53858
- 2026-10-03 Alias added: GHSA-jwcm-9g39-pmcw
References
More cli vulnerabilities
- TI-2025-18873 `gh attestation verify` returns incorrect exit code during verification if no attestations are present CVSS 3.1MEDIUM 6.3
- TI-2026-33538 gh: GitHub Actions log output in `gh run view` allows terminal escape sequence injection CVSS 3.1LOW 3.5
- TI-2024-34983 Connecting to a malicious Codespaces via GH CLI could allow command execution on the user's computer CVSS 3.1CRITICAL 9.6
- TI-2026-35862 GitHub CLI tokens leak via `gh attestation` commands CVSS 3.1CRITICAL 9.1
- TI-2024-36052 go-gh `auth.TokenForHost` violates GitHub host security boundary within a codespace CVSS 3.1HIGH 7.5
- TI-2024-36248 GitHub CLI allows downloading malicious GitHub Actions workflow artifact to result in path traversal vulnerability CVSS 4.0MEDIUM 6.3
Sources
- CVE-2024-53858 · CVE Program
- CVE-2024-53858 · NVD
- FIRST EPSS
- GHSA-jwcm-9g39-pmcw · GitHub Advisory Database · CC BY 4.0
- CVE-2024-53858 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences