CVE-2024-53859go-gh `auth.TokenForHost` violates GitHub host security boundary within a codespace
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.
What to do
Fixed builds are available from Go: see the table below for the fixed version per release.
Debian, Go, Ubuntu have not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.10 | golang-github-cli-go-gh-v2 | Fix pending | UBUNTU-CVE-2024-53859 | |
| Ubuntu 26.04 | golang-github-cli-go-gh-v2 | Under investigation | UBUNTU-CVE-2024-53859 | |
| Ubuntu 25.10 | golang-github-cli-go-gh-v2 | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2024-53859 | |
| Ubuntu 24.04 | golang-github-cli-go-gh-v2 | Fix pending | 2.6.0-1ubuntu0.24.04.1~esm1 (Ubuntu Pro) | UBUNTU-CVE-2024-53859 |
| Debian 14 | golang-github-cli-go-gh-v2 | Fix pending | DEBIAN-CVE-2024-53859 | |
| Debian 13 | golang-github-cli-go-gh-v2 | Fix pending | DEBIAN-CVE-2024-53859 | |
| Go library | github.com/cli/go-gh | Fix pending | GHSA-55v3-xh23-96gh | |
| Go library | github.com/cli/go-gh/v2 | Fixed | 2.11.1 | GHSA-55v3-xh23-96gh |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- cli go-gh: affected: < 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
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.