Recursive repository cloning can leak authentication tokens to non-GitHub submodule hosts
Published 27 Nov 2024 · Updated 10 Sept 2026
Is your project on an affected github.com/cli/cli/v2?
Look after several Go apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected package
- Affected
- <2.63.0
- Fixed in
- 2.63.0
go get github.com/cli/cli/v2@v2.63.0Details
Summary
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.
Details
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, 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 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:
GITHUB_ENTERPRISE_TOKENGH_ENTERPRISE_TOKENGITHUB_TOKEN_whenCODESPACESenvironment variable is set_
The result being git sending authentication tokens when cloning submodules.
In 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.
Impact
Successful exploitation could lead to a third-party using leaked authentication tokens to access privileged resources.
Remediation and mitigation
1. Upgrade gh to 2.63.0
2. Revoke authentication tokens used with the GitHub CLI:
3. Review your personal security log and any relevant audit logs for actions associated with your account or enterprise
Is GHSA-jwcm-9g39-pmcw in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected github.com/cli/cli/v2, and gives you the command that fixes it.
More advisories for github.com/cli/cli/v2
- LowCVE-2026-64653GitHub CLI allows path traversal through unescaped request URL components in github.com/cli/cli · 19 Oct 2026
- LowCVE-2026-64652GitHub CLI partially discloses authentication tokens in `gh auth status` output in github.com/cli/cli · 19 Oct 2026
- LowCVE-2026-64655GitHub CLI allows attestation verification bypass through unescaped regex metacharacters in github.com/cli/cli · 19 Oct 2026
- LowCVE-2026-64655GitHub CLI allows attestation verification bypass through unescaped regex metacharacters · 15 Oct 2026
- LowCVE-2026-64653GitHub CLI allows path traversal through unescaped request URL components · 15 Oct 2026
- LowCVE-2026-64652GitHub CLI partially discloses authentication tokens in `gh auth status` output · 15 Oct 2026
References
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.