Every CVE Search/ Get API key

CVE-2024-53858

Recursive repository cloning can leak authentication tokens to non-GitHub submodule hosts in the gh cli

6.5 MediumFix available

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

Attack profile

How easy it is to exploit

Attack vector
Local
Complexity
High
Privileges needed
None
User interaction
Required

What an attacker can affect

Confidentiality
High
Integrity
High
Availability
Low

Exploit likelihood

0.28%Up 0.2 points since Nov 28, 2024
90%50%10%1%

What each source reports

CVE List Score used 6.5

Recursive repository cloning can leak authentication tokens to non-GitHub submodule hosts in the gh cli

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

Record
CVE-2024-53858
CVSS 3.1
6.5 MediumCVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L
Weakness
CWE-200
Updated
2026-11-02
EUVDEUVD-2024-3397 6.5

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

Record
EUVD-2024-3397
CVSS 3.1
6.5 MediumCVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L
Updated
2026-11-03
GitHub AdvisoriesGHSA-jwcm-9g39-pmcw 6.5

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 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_TOKEN
  • GH_ENTERPRISE_TOKEN
  • GITHUB_TOKEN when CODESPACES environment 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
Record
GHSA-jwcm-9g39-pmcw
CVSS 3.1
6.5 MediumCVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L
Weakness
CWE-200
Updated
2026-11-02
NVD 6.5

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

Record
CVE-2024-53858
CVSS 3.1
6.5 MediumCVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L
Weakness
CWE-200
Updated
2026-11-02
OSV 6.5

Recursive repository cloning can leak authentication tokens to non-GitHub submodule hosts in the gh cli

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

Record
CVE-2024-53858
CVSS 3.1
6.5 MediumCVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L
Weakness
CWE-200
Updated
2026-11-02
OSVDEBIAN-CVE-2024-53858 6.5

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

Record
DEBIAN-CVE-2024-53858
CVSS 3.1
6.5 MediumCVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L
Updated
2026-11-02
Show 7 moreShow less
OSVGHSA-jwcm-9g39-pmcw 6.5

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 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_TOKEN
  • GH_ENTERPRISE_TOKEN
  • GITHUB_TOKEN when CODESPACES environment 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
Record
GHSA-jwcm-9g39-pmcw
CVSS 3.1
6.5 MediumCVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L
Weakness
CWE-200
Updated
2026-11-02
OSVUBUNTU-CVE-2024-53858 6.5

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

Record
UBUNTU-CVE-2024-53858
CVSS 3.1
6.5 MediumCVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L
Updated
2026-11-02
OSVAZL-53477 No score

CVE-2024-53858 affecting package gh for versions less than 2.62.0-5

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

Record
AZL-53477
Updated
2026-11-02
OSVAZL-53759 No score

CVE-2024-53858 affecting package gh for versions less than 2.13.0-24

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

Record
AZL-53759
Updated
2026-11-02
OSVGO-2024-3296 No score

Recursive repository cloning can leak authentication tokens to non-GitHub submodule hosts in github.com/cli/cli

Recursive repository cloning can leak authentication tokens to non-GitHub submodule hosts in github.com/cli/cli

Record
GO-2024-3296
Updated
2026-11-02
OSVopenSUSE-SU-2024:14567-1 No score

govulncheck-vulndb-0.0.20241209T183251-1.1 on GA media

These are all security issues fixed in the govulncheck-vulndb-0.0.20241209T183251-1.1 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2024:14567-1
Updated
2026-11-02
OSVUSN-8012-1 No score

gh vulnerabilities

It was discovered that GitHub CLI could behave unexpectedly if users downloaded a malicious GitHub Actions workflow artifact through gh run download. An attacker could possibly use this issue to create or overwrite files in unintended directories. (CVE-2024-54132)

It was discovered that GitHub CLI could behave unexpectedly when cloning repositories containing git submodules hosted outside of GitHub.com and ghe.com. An attacker could possibly use this issue to gather authentication tokens. (CVE-2024-53858)

Record
USN-8012-1
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
github.com/cli/cli/v2
Go
through 2.62.0
2.63.0
gh
Azure Linux:3
before 2.62.0-5
2.62.0-5
gh
Azure Linux:2
before 2.13.0-24
2.13.0-24
gh
Debian:12
All versions, plus listed versions
2.23.0+dfsg1-12.24.3+dfsg1-12.27.0+dfsg1-12.30.0-12.30.0-2
Show 11 moreShow less
2.35.0-12.40.1+dfsg1-12.42.1-12.43.1-12.44.1-12.44.1-22.45.0-12.46.0-12.46.0-22.46.0-32.46.0-4
None known
gh
Debian:13
before 2.46.0-3
2.46.0-3
github.com/cli/cli/v2
Go
before 2.63.0
2.63.0
github.com/cli/cli
Go
All versions None known
gh
Ubuntu:Pro:24.04:LTS
before 2.45.0-1ubuntu0.3+esm2, plus listed versions
2.27.0+dfsg1-1build12.30.0-22.35.0-12.40.1+dfsg1-12.42.1-1
Show 11 moreShow less
2.43.1-12.44.1-12.44.1-22.45.0-12.45.0-1build12.45.0-1ubuntu0.12.45.0-1ubuntu0.22.45.0-1ubuntu0.2+esm12.45.0-1ubuntu0.2+esm22.45.0-1ubuntu0.32.45.0-1ubuntu0.3+esm1
2.45.0-1ubuntu0.3+esm2
gh
Ubuntu:Pro:24.04:LTS
From an advisory covering 2 CVEs
before 2.45.0-1ubuntu0.3+esm2, plus listed versions
2.27.0+dfsg1-1build12.30.0-22.35.0-12.40.1+dfsg1-12.42.1-1
Show 11 moreShow less
2.43.1-12.44.1-12.44.1-22.45.0-12.45.0-1build12.45.0-1ubuntu0.12.45.0-1ubuntu0.22.45.0-1ubuntu0.2+esm12.45.0-1ubuntu0.2+esm22.45.0-1ubuntu0.32.45.0-1ubuntu0.3+esm1
2.45.0-1ubuntu0.3+esm2
govulncheck-vulndb
openSUSE:Tumbleweed
From an advisory covering 21 CVEs
before 0.0.20241209T183251-1.1
0.0.20241209T183251-1.1

History

History
RecordedChangedSources
affected, facts
aliases, publishedEUVD
first indexedCVE List, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2024-53858 is a medium vulnerability (CVSS 6.5) in Cli, published November 27, 2024. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.28%, the 20th percentile. Fixed in github.com/cli/cli/v2 2.63.0.

References

Show 27 moreShow less
MoveEnter Open