CVE-2024-53859
published 2024-11-27CVE-2024-53859: 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`…
PriorityP346high7.5CVSS 3.1
AVNACLPRNUINSUCHINAN
EPSS
0.53%
41.0th percentile
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.
Affected
5 ranges
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| cli | go-gh | < 2.11.1 | 2.11.1 |
| debian | golang-github-cli-go-gh-v2 | — | — |
| github.com | cli_go-gh_v2 | >= 0 < 2.11.1 | 2.11.1 |
| msrc | azl3_gh_2.62.0-1_on_azure_linux_3.0 | — | — |
| msrc | azl3_gh_2.62.0-8_on_azure_linux_3.0 | — | — |
CVSS provenance
nvdv3.17.5HIGHCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
osv7.5HIGH
vendor_debian6.5MEDIUM
vendor_msrc6.5MEDIUM
vendor_ubuntu6.5MEDIUM
Stop checking back — get the weekly exploitation signal.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
Ubuntu
go-gh vulnerability
vendor_ubuntu·2025-03-20·CVSS 6.5
CVE-2024-53859 [MEDIUM] go-gh vulnerability
Title: go-gh vulnerability
Summary: go-gh could be made to expose sensitive information over the
network.
It was discovered that go-gh incorrectly handled authentication
tokens. An attacker could possibly use this issue to leak
authentication tokens to the wrong host. (CVE-2024-53859)
Instructions: In general, a standard system update will make all the necessary changes.
Microsoft
go-gh `auth.TokenForHost` violates GitHub host security boundary within a codespace
vendor_msrc·2024-11-12·CVSS 6.5
CVE-2024-53859 [MEDIUM] CWE-200 go-gh `auth.TokenForHost` violates GitHub host security boundary within a codespace
go-gh `auth.TokenForHost` violates GitHub host security boundary within a codespace
FAQ: Is Azure Linux the only Microsoft product that includes this open-source library and is therefore potentially affected by this vulnerability?
One of the main benefits to our customers who choose to use the Azure Linux distro is the commitment to keep it up to date with the most recent and most secure versions of the open source libraries with which the distro is composed. Microsoft is committed to transparency in this work which is why we began publishing CSAF/VEX in October 2025. See this blog post for more information. If impact to additional products is identified, we will update the CVE to reflect this.
Mariner: Mariner
GitHub_M: GitHub_M
Customer Action Required: Yes
Remediation: CBL-Mariner
Debian
CVE-2024-53859: golang-github-cli-go-gh-v2 - go-gh is a Go module for interacting with the `gh` utility and the GitHub API fr...
vendor_debian·2024·CVSS 6.5
CVE-2024-53859 [MEDIUM] CVE-2024-53859: golang-github-cli-go-gh-v2 - go-gh is a Go module for interacting with the `gh` utility and the GitHub API fr...
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
OSV
golang-github-cli-go-gh-v2 vulnerability
osv·2025-03-20·CVSS 7.5
CVE-2024-53859 [HIGH] golang-github-cli-go-gh-v2 vulnerability
golang-github-cli-go-gh-v2 vulnerability
It was discovered that go-gh incorrectly handled authentication
tokens. An attacker could possibly use this issue to leak
authentication tokens to the wrong host. (CVE-2024-53859)
OSV
Violation of GitHub host security boundary when sourcing authentication token within a codespace in github.com/cli/go-gh
osv·2024-12-12
CVE-2024-53859 Violation of GitHub host security boundary when sourcing authentication token within a codespace in github.com/cli/go-gh
Violation of GitHub host security boundary when sourcing authentication token within a codespace in github.com/cli/go-gh
Violation of GitHub host security boundary when sourcing authentication token within a codespace in github.com/cli/go-gh
OSV
CVE-2024-53859: go-gh is a Go module for interacting with the `gh` utility and the GitHub API from the command line
osv·2024-11-27·CVSS 7.5
CVE-2024-53859 [HIGH] CVE-2024-53859: go-gh is a Go module for interacting with the `gh` utility and the GitHub API from the command line
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
OSV
`auth.TokenForHost` violates GitHub host security boundary when sourcing authentication token within a codespace
osv·2024-11-27
CVE-2024-53859 [MEDIUM] `auth.TokenForHost` violates GitHub host security boundary when sourcing authentication token within a codespace
`auth.TokenForHost` violates GitHub host security boundary when sourcing authentication token within a codespace
### Summary
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.
### Details
`go-gh` sources authentication tokens from different environment variables depending on the host involved:
- `GITHUB_TOKEN`, `GH_TOKEN` for GitHub.com and ghe.com
- `GITHUB_ENTERPRISE_TOKEN`, `GH_ENTERPRISE_TOKEN` for GitHub Enterprise Server
Prior to `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](https://github.com/cli/go-gh/blob/71770357e0cb12867d3e3e288854c0aa09d440b7
GHSA
`auth.TokenForHost` violates GitHub host security boundary when sourcing authentication token within a codespace
ghsa·2024-11-27
CVE-2024-53859 [MEDIUM] CWE-200 `auth.TokenForHost` violates GitHub host security boundary when sourcing authentication token within a codespace
`auth.TokenForHost` violates GitHub host security boundary when sourcing authentication token within a codespace
### Summary
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.
### Details
`go-gh` sources authentication tokens from different environment variables depending on the host involved:
- `GITHUB_TOKEN`, `GH_TOKEN` for GitHub.com and ghe.com
- `GITHUB_ENTERPRISE_TOKEN`, `GH_ENTERPRISE_TOKEN` for GitHub Enterprise Server
Prior to `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](https://github.com/cli/go-gh/blob/71770357e0cb12867d3e3e288854c0aa09d440b7
No detection rules found.
No public exploits indexed.
No writeups or analysis indexed.
https://docs.github.com/en/apps/using-github-apps/reviewing-and-revoking-authorization-of-github-apps#reviewing-your-authorized-github-appshttps://docs.github.com/en/authentication/keeping-your-account-and-data-secure/reviewing-your-security-loghttps://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-tokenhttps://docs.github.com/en/enterprise-cloud@latest/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokenshttps://github.com/cli/go-gh/blob/71770357e0cb12867d3e3e288854c0aa09d440b7/pkg/auth/auth.go#L73-L77https://github.com/cli/go-gh/security/advisories/GHSA-55v3-xh23-96gh
2024-11-27
Published