Every CVE Search/ Get API key

CVE-2024-53859

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

6.5 MediumFix available

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.

Attack profile

How easy it is to exploit

Attack vector
Local
Complexity
High
Privileges needed
None
User interaction
Required

What an attacker can affect

Confidentiality
High
Integrity
High
Availability
Low

Exploit likelihood

0.55%Up 0.5 points since Nov 28, 2024
90%50%10%1%

What each source reports

CVE List Score used 6.5

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

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.

Record
CVE-2024-53859
CVSS 3.1
6.5 MediumCVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L
Weakness
CWE-200
Updated
2026-11-02
EUVDEUVD-2024-3396 6.5

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.

Record
EUVD-2024-3396
CVSS 3.1
6.5 MediumCVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L
Updated
2026-11-03
GitHub AdvisoriesGHSA-55v3-xh23-96gh 6.5

`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.

In 2.11.1, auth.TokenForHost will only source a token from the GITHUB_TOKEN environment variable for GitHub.com or ghe.com hosts.

Impact

Successful exploitation could send authentication token to an unintended host.

Remediation and mitigation

  1. Upgrade go-gh to 2.11.1
  2. Advise extension users to regenerate authentication tokens:
  3. Advise extension users to review their personal security log and any relevant audit logs for actions associated with their account or enterprise
Record
GHSA-55v3-xh23-96gh
CVSS 3.1
6.5 MediumCVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L
Weakness
CWE-200
Updated
2026-11-02
NVD 6.5

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.

Record
CVE-2024-53859
CVSS 3.1
6.5 MediumCVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Weakness
CWE-200
Updated
2026-11-02
OSV 6.5

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

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.

Record
CVE-2024-53859
CVSS 3.1
6.5 MediumCVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L
Weakness
CWE-200
Updated
2026-11-02
OSVDEBIAN-CVE-2024-53859 7.5

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.

Record
DEBIAN-CVE-2024-53859
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Updated
2026-11-02
Show 6 moreShow less
OSVGHSA-55v3-xh23-96gh 6.5

`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.

In 2.11.1, auth.TokenForHost will only source a token from the GITHUB_TOKEN environment variable for GitHub.com or ghe.com hosts.

Impact

Successful exploitation could send authentication token to an unintended host.

Remediation and mitigation

  1. Upgrade go-gh to 2.11.1
  2. Advise extension users to regenerate authentication tokens:
  3. Advise extension users to review their personal security log and any relevant audit logs for actions associated with their account or enterprise
Record
GHSA-55v3-xh23-96gh
CVSS 3.1
6.5 MediumCVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L
Weakness
CWE-200
Updated
2026-11-02
OSVUBUNTU-CVE-2024-53859 6.5

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.

Record
UBUNTU-CVE-2024-53859
CVSS 3.1
6.5 MediumCVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Updated
2026-11-02
OSVAZL-53453 No score

CVE-2024-53859 affecting package gh for versions less than 2.62.0-5

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.

Record
AZL-53453
Updated
2026-11-02
OSVGO-2024-3295 No score

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

Record
GO-2024-3295
Updated
2026-11-02
OSVopenSUSE-SU-2024:14599-1 No score

govulncheck-vulndb-0.0.20241213T205935-1.1 on GA media

These are all security issues fixed in the govulncheck-vulndb-0.0.20241213T205935-1.1 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2024:14599-1
Updated
2026-11-02
OSVUSN-7362-1 No score

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)

Record
USN-7362-1
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
github.com/cli/go-gh/v2
Go
through 2.11.0
2.11.1
github.com/cli/go-gh
Go
before 2.11.1
2.11.1
gh
Azure Linux:3
before 2.62.0-5
2.62.0-5
golang-github-cli-go-gh-v2
Debian:13
All versions, plus listed versions
2.6.0-2
None known
golang-github-cli-go-gh-v2
Debian:14
All versions, plus listed versions
2.6.0-2
None known
github.com/cli/go-gh/v2
Go
before 2.11.1
2.11.1
github.com/cli/go-gh
Go
All versions None known
golang-github-cli-go-gh-v2
Ubuntu:Pro:24.04:LTS
before 2.6.0-1ubuntu0.24.04.1~esm1, plus listed versions
2.0.0-22.3.0-12.4.0+git20231120.d32c104-12.5.0-12.6.0-1
2.6.0-1ubuntu0.24.04.1~esm1
golang-github-cli-go-gh-v2
Ubuntu:25.10
All versions, plus listed versions
2.6.0-2
None known
golang-github-cli-go-gh-v2
Ubuntu:26.10
All versions, plus listed versions
2.6.0-2
None known
golang-github-cli-go-gh-v2
Ubuntu:26.04:LTS
All versions, plus listed versions
2.6.0-2
None known
govulncheck-vulndb
openSUSE:Tumbleweed
From an advisory covering 21 CVEs
before 0.0.20241213T205935-1.1
0.0.20241213T205935-1.1

History

History
RecordedChangedSources
affected, facts
aliases, publishedEUVD
first indexedCVE List, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2024-53859 is a medium vulnerability (CVSS 6.5) in Cli Go-gh, published November 27, 2024. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.55%, the 46th percentile. Fixed in github.com/cli/go-gh/v2 2.11.1.

References

Show 31 moreShow less
MoveEnter Open