# CVE-2024-53858: Recursive repository cloning can leak authentication tokens to non-GitHub submodule hosts in the gh cli

> CVE-2024-53858: Recursive repository cloning can leak authentication tokens to non-GitHub submodule hosts in the gh cli. CVSS 6.5 (CVSS 3.1).

Canonical: https://rewindex.com/cve/CVE-2024-53858
Last updated: 2026-06-17T08:09:25Z

- Published: 2024-11-27 21:25 UTC · Updated: 2026-06-17 08:09 UTC · Assigner: GitHub\_M
- CVSS: 6.5 (CVSS 3.1) · Severity: Medium · Vector: CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L
- EPSS: 0.28%, 20th percentile (scored 2026-10-25)
- CISA KEV: no
- CWE: CWE-200

## Description

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

## Affected vendors and products

- cli: cli
- github: cli

## Tracked companies

- [GitHub](https://rewindex.com/company/github.md)

## References

- [CVE record on cve.org](https://www.cve.org/CVERecord?id=CVE-2024-53858)
- [NVD entry](https://nvd.nist.gov/vuln/detail/CVE-2024-53858)
- [https://github.com/cli/cli/security/advisories/GHSA-jwcm-9g39-pmcw](https://github.com/cli/cli/security/advisories/GHSA-jwcm-9g39-pmcw)
- [https://git-scm.com/docs/gitcredentials](https://git-scm.com/docs/gitcredentials)

---

_Sources: CVE records from the CVE Program (cve.org). CVE® is a registered trademark of The MITRE Corporation. (https://www.cve.org/) This product uses data from the NVD API but is not endorsed or certified by the NVD. (https://nvd.nist.gov/) Known Exploited Vulnerabilities catalog from CISA. (https://www.cisa.gov/known-exploited-vulnerabilities-catalog) EPSS scores from FIRST (Exploit Prediction Scoring System). (https://www.first.org/epss/)_


---
Canonical: https://rewindex.com/cve/CVE-2024-53858 · Markdown: https://rewindex.com/cve/CVE-2024-53858.md · JSON: https://rewindex.com/api/v1/cves/CVE-2024-53858 · Data licensed CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) · Generated 2026-10-26T03:11:42.918Z
