p PatchFirst

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.

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 | sh
Check your server for free →

Channels 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

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

Check your server →