Skip to content
Heist/ feed
Back to feed
HighFix available

golang-github-cli-go-gh-v2 — security advisory

Type: advisorySources: OSVAdvisory ID: UBUNTU-CVE-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` 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.

Products
golang-github-cli-go-gh-v2
Affected versions
2.0.0-2, 2.3.0-1, 2.4.0+git20231120.d32c104-1, 2.5.0-1, 2.6.0-1, 2.6.0-2
Fixed versions
2.6.0-1ubuntu0.24.04.1~esm1
CVEs
CVE-2024-53859
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 01:23 UTC · Revision 1

Source evidence

UBUNTU-CVE-2024-53859

core-osv · Original source

Published 27 Nov 2024, 22:15 UTC

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.

osv:UBUNTU-CVE-2024-53859

golang-github-cli-go-gh-v2

Fixed versions: 2.6.0-1ubuntu0.24.04.1~esm1

golang-github-cli-go-gh-v2

Fixed versions: Not specified

golang-github-cli-go-gh-v2

Fixed versions: Not specified

golang-github-cli-go-gh-v2

Fixed versions: Not specified

Complete source record
{
  "id": "a3503ef11059efeaf40a354c1270294f9435d97a9aab4bd8446e6d18dd83df68",
  "url": "https://osv.dev/vulnerability/UBUNTU-CVE-2024-53859",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "UBUNTU-CVE-2024-53859",
    "summary": "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.",
    "evidence": "osv:UBUNTU-CVE-2024-53859",
    "products": [
      {
        "name": {
          "value": "golang-github-cli-go-gh-v2",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "2.6.0-1ubuntu0.24.04.1~esm1",
            "evidence": "/affected/0/ranges"
          }
        ],
        "affected_versions": [
          {
            "value": "2.0.0-2",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "2.3.0-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "2.4.0+git20231120.d32c104-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "2.5.0-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "2.6.0-1",
            "evidence": "/affected/0/versions"
          }
        ]
      },
      {
        "name": {
          "value": "golang-github-cli-go-gh-v2",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "2.6.0-2",
            "evidence": "/affected/1/versions"
          }
        ]
      },
      {
        "name": {
          "value": "golang-github-cli-go-gh-v2",
          "evidence": "/affected/2/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "2.6.0-2",
            "evidence": "/affected/2/versions"
          }
        ]
      },
      {
        "name": {
          "value": "golang-github-cli-go-gh-v2",
          "evidence": "/affected/3/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "2.6.0-2",
            "evidence": "/affected/3/versions"
          }
        ]
      }
    ],
    "severity": "high",
    "structured": {
      "id": "UBUNTU-CVE-2024-53859",
      "aliases": [
        "UBUNTU-CVE-2024-53859"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L"
        },
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
        },
        {
          "type": "Ubuntu",
          "score": "medium"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "2.6.0-1ubuntu0.24.04.1~esm1"
                }
              ]
            }
          ],
          "package": {
            "name": "golang-github-cli-go-gh-v2",
            "purl": "pkg:deb/ubuntu/golang-github-cli-go-gh-v2?arch=source&distro=esm-apps%2Fnoble",
            "ecosystem": "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"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-53859.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "golang-github-cli-go-gh-v2-dev",
                "binary_version": "2.6.0-1ubuntu0.24.04.1~esm1"
              }
            ],
            "availability": "Available with Ubuntu Pro: https://ubuntu.com/pro"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "golang-github-cli-go-gh-v2",
            "purl": "pkg:deb/ubuntu/golang-github-cli-go-gh-v2?arch=source&distro=questing",
            "ecosystem": "Ubuntu:25.10"
          },
          "versions": [
            "2.6.0-2"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-53859.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "golang-github-cli-go-gh-v2-dev",
                "binary_version": "2.6.0-2"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "golang-github-cli-go-gh-v2",
            "purl": "pkg:deb/ubuntu/golang-github-cli-go-gh-v2?arch=source&distro=stonking",
            "ecosystem": "Ubuntu:26.10"
          },
          "versions": [
            "2.6.0-2"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-53859.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "golang-github-cli-go-gh-v2-dev",
                "binary_version": "2.6.0-2"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "golang-github-cli-go-gh-v2",
            "purl": "pkg:deb/ubuntu/golang-github-cli-go-gh-v2?arch=source&distro=resolute",
            "ecosystem": "Ubuntu:26.04:LTS"
          },
          "versions": [
            "2.6.0-2"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-53859.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "golang-github-cli-go-gh-v2-dev",
                "binary_version": "2.6.0-2"
              }
            ]
          }
        }
      ],
      "modified": "2026-10-17T12:56:45.802445692Z",
      "provider": "osv",
      "upstream": [
        "CVE-2024-53859"
      ],
      "references": [
        "https://ubuntu.com/security/CVE-2024-53859",
        "https://www.cve.org/CVERecord?id=CVE-2024-53859",
        "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://ubuntu.com/security/notices/USN-7362-1"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2024-53859",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/1/score"
  },
  "source_id": "core-osv",
  "document_id": 356188,
  "published_at": "2024-11-27T22:15:00+00:00"
}