{"id":"CVE-2024-53859","published":"2024-11-27T21:25:12Z","modified":"2024-12-03T16:15:49Z","title":"go-gh `auth.TokenForHost` violates GitHub host security boundary within a codespace","vendor":"cli","product":"go-gh","tier":"tail","description":{"text":"go-gh is a Go module for interacting with the `gh` utility and the GitHub API from the command line. A security vulnerability has been identified in `go-gh` that could leak authentication tokens intended for GitHub hosts to non-GitHub hosts when within a codespace. `go-gh` sources authentication tokens from different environment variables depending on the host involved: 1. `GITHUB_TOKEN`, `GH_TOKEN` for GitHub.com and ghe.com and 2. `GITHUB_ENTERPRISE_TOKEN`, `GH_ENTERPRISE_TOKEN` for GitHub Enterprise Server. Prior to version `2.11.1`, `auth.TokenForHost` could source a token from the `GITHUB_TOKEN` environment variable for a host other than GitHub.com or ghe.com when within a codespace. In version `2.11.1`, `auth.TokenForHost` will only source a token from the `GITHUB_TOKEN` environment variable for GitHub.com or ghe.com hosts. Successful exploitation could send authentication token to an unintended host. This issue has been addressed in version 2.11.1 and all users are advised to upgrade. Users are also advised to regenerate authentication tokens and to review their personal security log and any relevant audit logs for actions associated with their account or enterprise.","provenance":"source","from":"CVE.org"},"cvss":{"score":6.5,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00548,"percentile":0.46811,"provenance":"source"},"cwes":[{"id":"CWE-200","name":"Exposure of Sensitive Information to an Unauthorized Actor"}],"references":[{"url":"https://github.com/cli/go-gh/security/advisories/GHSA-55v3-xh23-96gh","tags":["x_refsource_CONFIRM"]},{"url":"https://docs.github.com/en/apps/using-github-apps/reviewing-and-revoking-authorization-of-github-apps#reviewing-your-authorized-github-apps","tags":["x_refsource_MISC"]},{"url":"https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/reviewing-your-security-log","tags":["x_refsource_MISC"]},{"url":"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","tags":["x_refsource_MISC"]},{"url":"https://docs.github.com/en/enterprise-cloud@latest/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens","tags":["x_refsource_MISC"]},{"url":"https://github.com/cli/go-gh/blob/71770357e0cb12867d3e3e288854c0aa09d440b7/pkg/auth/auth.go#L73-L77","tags":["x_refsource_MISC"]}],"priority":{"score":13.9,"factors":[{"name":"EPSS percentile","points":9.36},{"name":"CVSS severity","points":4.55}]},"vendorSlug":"cli","affectedVersions":[{"vendor":"cli","product":"go-gh","versions":["< 2.11.1"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2024-12-03T16:13:23.904468Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Go","package":"github.com/cli/go-gh/v2","vulnerableRanges":["<2.11.1"],"patched":["2.11.1"],"from":["GHSA-55v3-xh23-96gh","GO-2024-3295"],"provenance":"source"},{"ecosystem":"Go","package":"github.com/cli/go-gh","vulnerableRanges":["<2.11.1","all versions"],"patched":[],"from":["GHSA-55v3-xh23-96gh","GO-2024-3295"],"provenance":"source"}],"summary":{"text":"The go-gh Go module's auth.TokenForHost function can source the GITHUB_TOKEN environment variable for hosts other than GitHub.com or ghe.com when running inside a codespace, causing GitHub authentication tokens to be exposed to non-GitHub hosts. An attacker who can get a user to interact with a crafted interaction in a codespace context (user interaction required, local access, no prior authentication) can cause that token to be sent to an unintended host and capture it, with confidentiality and integrity impact.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:41:35Z"},"euvd":{"id":"EUVD-2024-3396","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2024-53859","published":"2024-11-27","fixed":"2.11.1","kev":false},{"cve":"CVE-2025-48938","published":"2025-05-30","fixed":"2.12.1","kev":false,"link":{"from":"CVE-2024-53859","to":"CVE-2025-48938","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Go:github.com/cli/go-gh/v2","fromFixed":"2.11.1","toFixed":"2.12.1","daysApart":184}]}}],"package":"Go:github.com/cli/go-gh/v2"}}