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

CVE-2024-53858 is fixed in 2 products on 2 platforms, first by GitHub CLI 2.63.0, released November 27, 2024. It is not reported as exploited. Patch Radar priority: Routine.

- Web page: https://patchblox.com/security/cve/CVE-2024-53858
- Priority: Routine
- CVSS: 6.5 (medium)
- EPSS: 0.0028
- CISA KEV: not listed
- Exploited (vendor report): no
- Publicly disclosed: no
- Published: Nov 27, 2024
- Weakness: CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
- Vendor advisory: https://nvd.nist.gov/vuln/detail/CVE-2024-53858

## 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

## Where it's fixed

| Platform | Product | Fixed in | Fix | Released |
|---|---|---|---|---|
| Windows apps | GitHub CLI | 2.63.0 | [GitHub CLI 2.63.0](https://patchblox.com/security/data/fix/windows-app/github.cli-2.63.0.md) | Nov 27, 2024 |
| Linux | gh Debian 13.5 (trixie) | 2.46.0-3 | [DEBIAN-CVE-2024-53858](https://patchblox.com/security/data/fix/linux/debian-cve-2024-53858.md) | Nov 27, 2024 |
| Linux | gh Ubuntu 24.04.5 LTS (noble) | 2.45.0-1ubuntu0.3+esm2 | [gh 2.45.0-1ubuntu0.3+esm2](https://patchblox.com/security/data/fix/linux/ubuntu-noble-gh-2.45.0-1ubuntu0.3-esm2.md) | Dec 4, 2024 |

---

Data as of 2026-11-08T19:12:23Z UTC. Source: Patchblox Patch Radar (https://patchblox.com/security/patch-radar). Patchblox finds out-of-date software on Windows, macOS and Linux and updates it through release rings: https://patchblox.com/demo

Free to use with attribution: show "Data: Patchblox Patch Radar" with a link to https://patchblox.com/security/patch-radar. Terms, including what needs a written agreement: https://patchblox.com/security/patch-radar/use-the-data

Product names, logos and trademarks shown on Patch Radar belong to their respective owners. They are used only to identify the software each security fix applies to and to help readers find their platform. Their use does not imply any affiliation with, or endorsement by, those owners, and Patchblox is not affiliated with any of them.
