CVE-2024-53859
CVE-2024-53859 · go-gh `auth.TokenForHost` violates GitHub host security boundary within a codespace
CVSS 6.5 · Medium · EPSS 0.5% · Fix available
Compare with your installed version
Affected products and known fixed versions are public information. Compare them with your installed version.
- go-ghNo fix published
- golang-github-cli-go-gh-v2 Debian 13No fix published
- golang-github-cli-go-gh-v2 Debian 14No fix published
- golang-github-cli-go-gh-v2 Ubuntu Pro 24.04 LTSUpdate to 2.6.0-1ubuntu0.24.04.1~esm1
- and 3 more
Check the installed version:
dpkg-query -W -f='${source:Package} ${binary:Package} ${Version}\n' | awk '$1=="golang-github-cli-go-gh-v2"'Assess your server’s risks
The free check gives you a rating and a risk summary by technology stack, without signing up. It does not answer whether this particular vulnerability affects you.
Monitoring matches public information against your servers’ software. Detailed findings for your servers include the order of updates.
curl -fsSL https://patchfirst.dev/check.sh | shChannels carry general technology news; monitoring reports new findings on your servers in your dashboard, through browser notifications, in Telegram or via a webhook.
This page contains facts from public vulnerability sources. Check the original advisory before updating.
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.
- Published
- Updated
Fixes in distributions
- USN-7362-1 · Ubuntu Pro 24.04 LTS ·
- openSUSE-SU-2024:14599-1 · openSUSE Tumbleweed ·
Stack: system
Affected products and versions
go-gh
- Versions
- < 2.11.1: Affected
No fix published
golang-github-cli-go-gh-v2 Debian 13
- Versions
- 2.17.0-1
- 2.17.0-1~exp1
- 2.6.0-2
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
golang-github-cli-go-gh-v2 Debian 14
- Versions
- 2.17.0-1
- 2.17.0-1~exp1
- 2.6.0-2
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
golang-github-cli-go-gh-v2 Ubuntu Pro 24.04 LTS
- Versions
- 2.0.0-2
- 2.3.0-1
- 2.4.0+git20231120.d32c104-1
- 2.5.0-1
- 2.6.0-1
- Affected ranges
- ECOSYSTEM: < 2.6.0-1ubuntu0.24.04.1~esm1
Update to 2.6.0-1ubuntu0.24.04.1~esm1
golang-github-cli-go-gh-v2 Ubuntu 25.10
- Versions
- 2.6.0-2
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
golang-github-cli-go-gh-v2 Ubuntu 26.10
- Versions
- 2.6.0-2
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
golang-github-cli-go-gh-v2 Ubuntu 26.04 LTS
- Versions
- 2.6.0-2
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
Original sources
- 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://nvd.nist.gov/vuln/detail/CVE-2024-53859