# CVE-2024-53859: go-gh \`auth.TokenForHost\` violates GitHub host security boundary within a codespace

- Priority: **Routine**
- Reason: Not severe (CVSS 6.5, local access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2024-11-27 · Modified: 2024-12-03
- Aliases: UBUNTU-CVE-2024-53859, USN-7362-1, DEBIAN-CVE-2024-53859, CGA-97m2-hgv3-5crv, CGA-mj2w-92gw-qrhw, CGA-q5rr-8wmw-ff35, CGA-x9qf-w35x-phqx, GHSA-55v3-xh23-96gh, GO-2024-3295
- Record: https://cvemate.com/vulnerability/CVE-2024-53859 · JSON: https://cvemate.com/vulnerability/CVE-2024-53859/json

## 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.
```

## Signals

- CVSS: 7.5 high (v3.1, NVD) CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
- EPSS: 0.548%, percentile 47.366%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected

- chainguard gh (Chainguard): \< 2.63.0-r0
- chainguard wolfictl (Chainguard): \< 0.26.0-r1
- wolfi gh (Wolfi): \< 2.63.0-r0
- wolfi wolfictl (Wolfi): \< 0.26.0-r1
- cli go-gh: \< 2.11.1
- debian golang-github-cli-go-gh-v2 (Debian): All versions (No fix recorded)
- ubuntu golang-github-cli-go-gh-v2 (Ubuntu): \< 2.6.0-1ubuntu0.24.04.1~esm1 \| All versions (No fix recorded)
- github.com/cli go-gh (Go): All versions (No fix recorded)
- github.com/cli/go-gh v2 (Go): \< 2.11.1

## References

- <https://github.com/cli/go-gh/security/advisories/GHSA-55v3-xh23-96gh>
- <https://docs.github.com/en/apps/using-github-apps/reviewing-and-revoking-authorization-of-github-apps#reviewing-your-authorized-github-apps>
- <https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/reviewing-your-security-log>
- <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>
- <https://docs.github.com/en/enterprise-cloud@latest/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens>
- <https://github.com/cli/go-gh/blob/71770357e0cb12867d3e3e288854c0aa09d440b7/pkg/auth/auth.go#L73-L77>
- <https://ubuntu.com/security/CVE-2024-53859>
- <https://www.cve.org/CVERecord?id=CVE-2024-53859>
- <https://ubuntu.com/security/notices/USN-7362-1>
- <https://security-tracker.debian.org/tracker/CVE-2024-53859>
- <https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/53xxx/CVE-2024-53859.json>
- <https://nvd.nist.gov/vuln/detail/CVE-2024-53859>
- <https://github.com/cli/go-gh>
- <https://pkg.go.dev/vuln/GO-2024-3295>

---

Data as of 2026-12-05T08:24:34.951Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
