{"id":"GHSA-jwcm-9g39-pmcw","revision":"170c1787ce2644c9b2351ddc7f1edbf4","records":[{"revision":"170c1787ce2644c9b2351ddc7f1edbf4","observedAt":"2026-10-24T13:19:41.952+00:00","statement":{"source":"osv","id":"GHSA-jwcm-9g39-pmcw","aliases":["CVE-2024-53858","GO-2024-3296"],"title":"Recursive repository cloning can leak authentication tokens to non-GitHub submodule hosts","description":"### Summary\n\nA 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.\n\n### Details\n\nThis 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`](https://git-scm.com/docs/gitcredentials) configuration variable for any host encountered.\n\nPrior 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:\n\n- `GITHUB_ENTERPRISE_TOKEN`\n- `GH_ENTERPRISE_TOKEN`\n- `GITHUB_TOKEN` _when `CODESPACES` environment variable is set_\n\nThe result being `git` sending authentication tokens when cloning submodules.\n\nIn `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.\n\n### Impact\n\nSuccessful exploitation could lead to a third-party using leaked authentication tokens to access privileged resources.\n\n### Remediation and mitigation\n\n1. Upgrade `gh` to `2.63.0`\n2. Revoke authentication tokens used with the GitHub CLI: \n    - [Personal access tokens](https://docs.github.com/en/enterprise-cloud@latest/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens)\n    - [GitHub CLI OAuth app](https://docs.github.com/en/apps/using-github-apps/reviewing-and-revoking-authorization-of-github-apps#reviewing-your-authorized-github-apps)\n3. Review your personal [security log](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/reviewing-your-security-log) and any relevant [audit logs](https://docs.github.com/en/enterprise-cloud@latest/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/identifying-audit-log-events-performed-by-an-access-token) for actions associated with your account or enterprise","state":0,"publishedAt":"2024-11-27T21:43:05+00:00","modifiedAt":"2026-09-10T03:50:20.798741+00:00","affected":[{"ecosystem":"Go","name":"github.com/cli/cli/v2","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"2.63.0"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"MODERATE"}],"references":["https://github.com/cli/cli/security/advisories/GHSA-jwcm-9g39-pmcw","https://nvd.nist.gov/vuln/detail/CVE-2024-53858","https://git-scm.com/docs/gitcredentials","https://github.com/cli/cli"],"sourceUrl":"https://github.com/advisories/GHSA-jwcm-9g39-pmcw","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-jwcm-9g39-pmcw","identifiers":["GHSA-jwcm-9g39-pmcw","CVE-2024-53858","GO-2024-3296"]},"retained":false,"historicalAffected":[]}],"coverage":[]}