CVE-2024-53859
go-gh `auth.TokenForHost` violates GitHub host security boundary within a codespace
Reported by github_m · Published November 27, 2024
github.com/cli/go-gh/v2 is fixed in 2.11.1 (Go Modules)
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| github.com/cli/go-gh/v2 | Go Modules | 2.11.1 |
| wolfictl | Chainguard | 0.26.0-r1 |
| gh | Chainguard | 2.63.0-r0 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| cli | go-gh | < 2.11.1 |
| chainguard | wolfictl | 0 |
| chainguard | gh | 0 |
| github.com | cli/go-gh/v2 | 0 |
| cli | go-gh | 0 |
| wolfi | gh | 0 |
| wolfi | wolfictl | 0 |
| github | go-gh | 0 |
| github.com | cli/go-gh | 0 |
Timeline
- Nov 27, 2024 CVE Published
- Nov 27, 2024 PoC Published (2 in total, the first dated here)
- Nov 28, 2024 EPSS Score (30 in total, the first dated here)
- Nov 29, 2024 Coalition ESS Score (21 in total, the first dated here)
- Dec 31, 2025 Security Advisory (2 in total, the first dated here)
- Jun 17, 2026 CVE Updated
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2024-53859
vulnetix vdb fixes CVE-2024-53859
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2024-53859/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- https://github.com/cli/go-gh/security/advisories/GHSA-55v3-xh23-96gh x_refsource_CONFIRM
- https://docs.github.com/en/apps/using-github-apps/reviewing-and-revoking-authorization-of-github-apps#reviewing-your-authorized-github-apps x_refsource_MISC
- https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/reviewing-your-security-log x_refsource_MISC
- 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 x_refsource_MISC
- https://docs.github.com/en/enterprise-cloud@latest/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens x_refsource_MISC
- https://github.com/cli/go-gh/blob/71770357e0cb12867d3e3e288854c0aa09d440b7/pkg/auth/auth.go#L73-L77 x_refsource_MISC
- https://nvd.nist.gov/vuln/detail/CVE-2024-53859 advisory
- https://github.com/advisories/GHSA-55v3-xh23-96gh advisory
- https://github.com/cli/go-gh url
- https://pkg.go.dev/vuln/GO-2024-3295 url