CVEfocus › CVE database › CVE-2024-53859

CVE-2024-53859go-gh `auth.TokenForHost` violates GitHub host security boundary within a codespace

CVSS 6.5 MediumEPSS 0.8% (higher than 53% of CVEs)Published 2024-11-27Updated 2024-12-03Assigner: GitHub_M

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.

CWE-200

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

1Fixed
5Fix pending
1Under investigation
1Will not fix

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.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 26.10golang-github-cli-go-gh-v2Fix pendingUBUNTU-CVE-2024-53859
Ubuntu 26.04golang-github-cli-go-gh-v2Under investigationUBUNTU-CVE-2024-53859
Ubuntu 25.10golang-github-cli-go-gh-v2Will not fix
Ubuntu decided not to fix this in this release
UBUNTU-CVE-2024-53859
Ubuntu 24.04golang-github-cli-go-gh-v2Fix pending2.6.0-1ubuntu0.24.04.1~esm1 (Ubuntu Pro)UBUNTU-CVE-2024-53859
Debian 14golang-github-cli-go-gh-v2Fix pendingDEBIAN-CVE-2024-53859
Debian 13golang-github-cli-go-gh-v2Fix pendingDEBIAN-CVE-2024-53859
Go librarygithub.com/cli/go-ghFix pendingGHSA-55v3-xh23-96gh
Go librarygithub.com/cli/go-gh/v2Fixed2.11.1GHSA-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.

References

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.