CVE-2024-53858 Recursive repository cloning can leak authentication tokens to non-GitHub submodule hosts in the gh cli
- Published
- Updated
- Exploit status
- No public exploit known
- CISA SSVC
- No known exploitation · automatable: no · technical impact: total
- Technology
- UbuntuDebian
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
Upgrade path
8 packages: 5 fixed, 1 partially fixed, 1 with no fix yet.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| debian/gh(Debian 12) | = 2.23.0+dfsg1-1; = 2.24.3+dfsg1-1; = 2.27.0+dfsg1-1; = 2.30.0-1 +13 more | No fix listed | No fix yet |
| cli github.com/cli/cli(Go) | < 2.63.0; <= 2.62.0; All versions | 2.63.0 | Partially fixed |
| azure linux gh(Azure Linux 3.0) | < 2.62.0-5 | 2.62.0-5 | Fixed |
| cbl-mariner gh(CBL-Mariner 2.0) | < 2.13.0-24 | 2.13.0-24 | Fixed |
| debian/gh(Debian 13) | < 2.46.0-3 | 2.46.0-3 | Fixed |
| GitHub cli | < 2.63.0 | 2.63.0 | Fixed |
| ubuntu/gh(Ubuntu 24.04) | < 2.45.0-1ubuntu0.3+esm2 | 2.45.0-1ubuntu0.3+esm2 | Fixed |
| cli github.com/cli/cli | = < 2.63.0 | No fix listed | Versions listed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| cli github.com/cli/cli(Go) | < 2.63.0 | 2.63.0 |
| cli github.com/cli/cli(Go) | All versions | No fix listed |
| cbl-mariner gh(CBL-Mariner:2.0) | < 2.13.0-24 | 2.13.0-24 |
| azure linux gh(Azure Linux:3.0) | < 2.62.0-5 | 2.62.0-5 |
| cli github.com/cli/cli(Go) | <= 2.62.0 | No fix listed |
| debian/gh(Debian:12) | All versions | No fix listed |
| debian/gh(Debian:12) | = 2.23.0+dfsg1-1 | No fix listed |
| debian/gh(Debian:12) | = 2.24.3+dfsg1-1 | No fix listed |
| debian/gh(Debian:12) | = 2.27.0+dfsg1-1 | No fix listed |
| debian/gh(Debian:12) | = 2.30.0-1 | No fix listed |
| debian/gh(Debian:12) | = 2.30.0-2 | No fix listed |
| debian/gh(Debian:12) | = 2.35.0-1 | No fix listed |
| debian/gh(Debian:12) | = 2.40.1+dfsg1-1 | No fix listed |
| debian/gh(Debian:12) | = 2.42.1-1 | No fix listed |
| debian/gh(Debian:12) | = 2.43.1-1 | No fix listed |
| debian/gh(Debian:12) | = 2.44.1-1 | No fix listed |
| debian/gh(Debian:12) | = 2.44.1-2 | No fix listed |
| debian/gh(Debian:12) | = 2.45.0-1 | No fix listed |
| debian/gh(Debian:12) | = 2.46.0-1 | No fix listed |
| debian/gh(Debian:12) | = 2.46.0-2 | No fix listed |
| debian/gh(Debian:12) | = 2.46.0-3 | No fix listed |
| debian/gh(Debian:12) | = 2.46.0-4 | No fix listed |
| debian/gh(Debian:13) | < 2.46.0-3 | 2.46.0-3 |
| cli github.com/cli/cli | = < 2.63.0 | No fix listed |
| GitHub cli | < 2.63.0 | 2.63.0 |
Show 1 more
| Product | Affected versions | Fixed in |
|---|---|---|
| ubuntu/gh(Ubuntu:24.04) | < 2.45.0-1ubuntu0.3+esm2 | 2.45.0-1ubuntu0.3+esm2 |
References
- https://github.com/cli/cli/security/advisories/GHSA-jwcm-9g39-pmcw vendor-advisory
- nvd.nist.gov third-party-advisory vendor-advisory
- https://git-scm.com/docs/gitcredentials
- github.com product
- MSRC Security Update Guide vendor-advisory
- CBL-Mariner Releases vendor-advisory
- github.com
- Debian Security Tracker CVE-2024-53858 vendor-advisory
- Ubuntu CVE tracker vendor-advisory
- USN-8012-1 vendor-advisory
- www.cve.org
- bugs.debian.org issue-tracking