VDB

CVE-2024-53859

CVE-2024-53859 PUBLISHED CVSS 6.5 MEDIUM

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.

PackageEcosystemFixed in
github.com/cli/go-gh/v2Go Modules2.11.1
wolfictlChainguard0.26.0-r1
ghChainguard2.63.0-r0

Risk scores

CVSS 3.1
6.5
CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L

Affected products

VendorProductVersions
cligo-gh< 2.11.1
chainguardwolfictl0
chainguardgh0
github.comcli/go-gh/v20
cligo-gh0
wolfigh0
wolfiwolfictl0
githubgo-gh0
github.comcli/go-gh0

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

Look up in the Resolve Platform →
$ Lookup Community · 50/day Open Lookup ›