🛡️ CVE-2024-53858 — cli
Description
Recursive repository cloning can leak authentication tokens to non-GitHub submodule hosts
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](https://git-scm.com/docs/gitcredentials) 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:
- [Personal access tokens](https://docs.github.com/en/enterprise-cloud@latest/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens)
- [GitHub CLI OAuth app](https://docs.github.com/en/apps/using-github-apps/reviewing-and-revoking-authorization-of-github-apps#reviewing-your-authorized-github-apps)
3. Review your personal [security log](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/reviewing-your-security-log) and any relevant [audit logs](https://docs.github.com/en/enterprise-cloud@latest/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/identifying-audit-log-events-performed-by-an-access-token) for actions associated with your account or enterprise
How this vulnerability can be exploited
This issue can be reached with local access to the system, attack complexity is high, an attacker needs no privileges on the target. A user must be tricked into taking some action. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality high, integrity high, availability low.
Affected software
CVE-2024-53858 is recorded against 3 packages.
- github.com/cli/cli
- github.com/cli/cli/v2
- unknown
Timeline and source
Published on 2 December 2024 and last revised on 4 February 2026. No public exploit is currently recorded for this entry. Record sourced from NVD.
References
github.com (Advisory)
nvd.nist.gov (Advisory)
git-scm.com (Web)
CVE-2024-53858 on other distributions
Each distribution ships its own build and its own fixed version. Pick the one you run:
Details
CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L
Affected Packages
| Software | From version | Fixed in |
|---|---|---|
| github.com/cli/cli | — | — |
| github.com/cli/cli/v2 | — | — |
| unknown | — | — |
References
Similar Threats
- High CVE-2026-48501
- Low CVE-2026-45803
- Medium CVE-2025-25204
- Unknown CVE-2024-54132
- High CVE-2024-52308
More CVE 2024 advisories
Browse all of CVE 2024 in the advisory index.
Vulnerability Monitoring
Track new vulnerabilities in cli
CVE-2024-53858 is rated CVSS 6.5 Medium. BotEraser monitors your WordPress installation and notifies you when software you use appears in our vulnerability database.
Set Up Free Alerts →No credit card required · Results in minutes
ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.