CVE-2024-53858
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
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
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 Medium
CVSS: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 Medium
CVSS: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_TOKENGH_ENTERPRISE_TOKENGITHUB_TOKENwhenCODESPACESenvironment 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
- Upgrade
ghto2.63.0 - Revoke authentication tokens used with the GitHub CLI:
- 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 Medium
CVSS: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 Medium
CVSS: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 Medium
CVSS: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 Medium
CVSS: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_TOKENGH_ENTERPRISE_TOKENGITHUB_TOKENwhenCODESPACESenvironment 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
- Upgrade
ghto2.63.0 - Revoke authentication tokens used with the GitHub CLI:
- 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 Medium
CVSS: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 Medium
CVSS: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
| Package | Affected | Fixed |
|---|---|---|
github.com/cli/cli/v2Go |
through 2.62.0 | 2.63.0 |
ghAzure Linux:3 |
before 2.62.0-5 | 2.62.0-5 |
ghAzure Linux:2 |
before 2.13.0-24 | 2.13.0-24 |
ghDebian: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 less2.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 |
ghDebian:13 |
before 2.46.0-3 | 2.46.0-3 |
github.com/cli/cli/v2Go |
before 2.63.0 | 2.63.0 |
github.com/cli/cliGo |
All versions | None known |
ghUbuntu: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 less2.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 |
ghUbuntu: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 less2.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-vulndbopenSUSE:Tumbleweed From an advisory covering 21 CVEs |
before 0.0.20241209T183251-1.1 | 0.0.20241209T183251-1.1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | ||
| aliases, published | EUVD | |
| first indexed | CVE 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
github.com/cli/cli/security/advisories/GHSA-jwcm-9g39-pmcw
git-scm.com/docs/gitcredentials
nvd.nist.gov/vuln/detail/CVE-2024-53858
github.com/advisories/GHSA-jwcm-9g39-pmcw
github.com/CVEProject/cvelistV5/tree/main/cves/2024/53xxx/CVE-2024-53858.json
security-tracker.debian.org/tracker/CVE-2024-53858
Show 27 moreShow less
github.com/cli/cli
ubuntu.com/security/CVE-2024-53858
cve.org/CVERecord?id=CVE-2024-53858
ubuntu.com/security/notices/USN-8012-1
ubuntu.com/security/CVE-2024-54132
lists.opensuse.org/archives/list/[email protected]/thread/EK3MV2UFLDNRIXIWLVT5CJNSLB2MKFBU
suse.com/security/cve/CVE-2024-10220
suse.com/security/cve/CVE-2024-36620
suse.com/security/cve/CVE-2024-36621
suse.com/security/cve/CVE-2024-36623
suse.com/security/cve/CVE-2024-37820
suse.com/security/cve/CVE-2024-43784
suse.com/security/cve/CVE-2024-45719
suse.com/security/cve/CVE-2024-50948
suse.com/security/cve/CVE-2024-52003
suse.com/security/cve/CVE-2024-52529
suse.com/security/cve/CVE-2024-52801
suse.com/security/cve/CVE-2024-53259
suse.com/security/cve/CVE-2024-53264
suse.com/security/cve/CVE-2024-53858
suse.com/security/cve/CVE-2024-53862
suse.com/security/cve/CVE-2024-54131
suse.com/security/cve/CVE-2024-54132
suse.com/security/cve/CVE-2024-6156
suse.com/security/cve/CVE-2024-6219
suse.com/security/cve/CVE-2024-6538
suse.com/security/cve/CVE-2024-8676