{"answers":{"affected":"6 open source packages ship an affected version, including github.com/cli/go-gh and github.com/cli/go-gh/v2. It affects 1 product.","exploited":"There is no known exploitation of CVE-2024-53859 in the wild and no public exploit code.","fix":"Upgrade to a fixed version.","what":"CVE-2024-53859 is a medium-severity vulnerability in cli go-gh, published on 27 Nov 2024. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2024-53859 and fix it if it is affected.\n\nWhat it is: CVE-2024-53859 is a medium-severity vulnerability in cli go-gh, published on 27 Nov 2024. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of CVE-2024-53859 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- github.com/cli/go-gh (Go): affected all versions; no fix listed\n- github.com/cli/go-gh (Go): affected all versions; no fix listed\n- github.com/cli/go-gh (Go): affected all versions; no fix listed\n- github.com/cli/go-gh/v2 (Go): affected all versions; fixed in 2.11.1\n- github.com/cli/go-gh/v2 (Go): affected all versions; fixed in 2.11.1\n- github.com/cli/go-gh/v2 (Go): affected all versions; fixed in 2.11.1\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2024-53859/ (Markdown: https://insights.sbomify.com/CVE-2024-53859/index.md)","id":"CVE-2024-53859","markdown":"https://insights.sbomify.com/CVE-2024-53859/index.md","name":"CVE-2024-53859","record":{"aliases":["AZL-53453","DEBIAN-CVE-2024-53859","GHSA-55v3-xh23-96gh","GO-2024-3295","UBUNTU-CVE-2024-53859","USN-7362-1"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["data_read","account_takeover"],"network_reachable":"adjacent_or_local","non_default_config":true,"product_category":"Go GitHub CLI library","requires_auth":"none","summary":"Attackers can leak GitHub authentication tokens to unintended hosts within a codespace, potentially leading to account takeover.","user_interaction":"required","vuln_class":"information_disclosure"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"go-gh","vendor":"cli"}],"cvss":{"score":6.5,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L","version":"3.1"},"cwes":[{"id":"CWE-200","name":"Exposure of Sensitive Information to an Unauthorized Actor"}],"description":"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.","ecosystems":["Go"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"go-gh `auth.TokenForHost` violates GitHub host security boundary within a codespace","id":"CVE-2024-53859","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Go","product":null,"products":[],"type":"information_disclosure","year":"2024"},"n_packages":6,"n_references":6,"next":{"headline":"Potential Abuse for Sending Arbitrary Emails in sp-php-email-handler","id":"CVE-2024-53860"},"packages":[{"ecosystem":"Go","fixed":[],"introduced":["0"],"last_affected":[],"package":"github.com/cli/go-gh","purl":null,"source":"GHSA-55v3-xh23-96gh"},{"ecosystem":"Go","fixed":[],"introduced":["0"],"last_affected":[],"package":"github.com/cli/go-gh","purl":"pkg:golang/github.com/cli/go-gh","source":"GHSA-55v3-xh23-96gh"},{"ecosystem":"Go","fixed":[],"introduced":["0"],"last_affected":[],"package":"github.com/cli/go-gh","purl":"pkg:golang/github.com/cli/go-gh","source":"GO-2024-3295"},{"ecosystem":"Go","fixed":["2.11.1"],"introduced":["0"],"last_affected":[],"package":"github.com/cli/go-gh/v2","purl":null,"source":"GHSA-55v3-xh23-96gh"},{"ecosystem":"Go","fixed":["2.11.1"],"introduced":["0"],"last_affected":[],"package":"github.com/cli/go-gh/v2","purl":"pkg:golang/github.com/cli/go-gh/v2","source":"GHSA-55v3-xh23-96gh"},{"ecosystem":"Go","fixed":["2.11.1"],"introduced":["0"],"last_affected":[],"package":"github.com/cli/go-gh/v2","purl":"pkg:golang/github.com/cli/go-gh/v2","source":"GO-2024-3295"}],"prev":{"headline":"Recursive repository cloning can leak authentication tokens to non-GitHub submodule hosts in the gh cli","id":"CVE-2024-53858"},"products":["go-gh"],"published":"2024-11-27","related":[{"cvss_score":2.6,"headline":"Prevent GitHub CLI and extensions from executing arbitrary commands from compromised GitHub Enterprise Server","id":"CVE-2025-48938","kev_date_added":null,"published":"2025-05-30"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"Go Vulnerability Database","prefix":"GO"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"total"},"state":"PUBLISHED","updated":"2024-12-03","vendors":["cli"]},"summary":"Attackers can leak GitHub authentication tokens to unintended hosts within a codespace, potentially leading to account takeover.","url":"https://insights.sbomify.com/CVE-2024-53859/"}