CVE-2025-48938: Github.com/cli/go gh/v2 Prevent GitHub CLI And Extensions Vulnerability
MODERATECVE-2025-48938 is a MODERATE prevent github cli and extensions vulnerability (CWE-501: Trust Boundary Violation) affecting Github.com/cli/go gh/v2 libraries in the Go ecosystem. The issue involves prevent github cli and extensions from executing arbitrary commands from compromised github enterprise server. Remediation is available by upgrading affected packages to version 2.12.1.
CVE-2025-48938 at a Glance
How to Fix CVE-2025-48938
To remediate this vulnerability, upgrade all affected Github.com/cli/go gh/v2 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/cli/go-gh/v2 to 2.12.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/cli/go-gh/v2
How to Check if You Are Affected
To determine whether your application is affected by CVE-2025-48938, inspect your project dependencies for Github.com/cli/go gh/v2:
inspect dependencies for github.com/cli/go-gh/v2
Analyze the terminal output to locate any version of Github.com/cli/go gh/v2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.12.1), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-501: Trust Boundary Violation, where the product mixes trusted and untrusted data in the same data structure or structured message. In Github.com/cli/go gh/v2, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2025-48938 Affected Github.com/cli/go gh/v2 Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/cli/go-gh/v2
|
Go |
< 2.12.1
|
2.12.1
|
References
Frequently Asked Questions
What is CVE-2025-48938?
Which Github.com/cli/go gh/v2 versions are affected?
What version fixes CVE-2025-48938?
Is github.com/cli/go-gh/v2 affected?
What CWE is associated with CVE-2025-48938?
How can I check Go dependencies for CVE-2025-48938?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-g9f5-x53j-h563",
"modified" : "2025-06-04T21:00:35Z",
"published" : "2025-05-30T15:30:39Z",
"aliases" : [ "CVE-2025-48938" ],
"summary" : "Prevent GitHub CLI and extensions from executing arbitrary commands from compromised GitHub Enterprise Server",
"details" : "### Summary\n\nA security vulnerability has been identified in `go-gh` where an attacker-controlled GitHub Enterprise Server could result in executing arbitrary commands on a user's machine by replacing HTTP URLs provided by GitHub with local file paths for browsing. \n\n### Details\n\nThe GitHub CLI and CLI extensions allow users to transition from their terminal for a variety of use cases through the [`Browser` capability in `github.com/cli/go-gh/v2/pkg/browser`](https://github.com/cli/go-gh/blob/61bf393cf4aeea6d00a6251390f5f67f5b67e727/pkg/browser/browser.go):\n\n- Using the `-w, --web` flag, GitHub CLI users can view GitHub repositories, issues, pull requests, and more using their web browser\n- Using the `gh codespace` command set, GitHub CLI users can transition to Visual Studio Code to work with GitHub Codespaces\n\nThis is done by using URLs provided through API responses from authenticated GitHub hosts when users execute `gh` commands.\n\nPrior to `2.12.1`, `Browser.Browse()` would attempt to open the provided URL using a variety of OS-specific approaches regardless of the scheme. An attacker-controlled GitHub Enterprise Server could modify API responses to use a specially tailored local executable path instead of HTTP URLs to resources. This could allow the attacker to execute arbitrary executables on the user's machine. \n\nIn `2.12.1`, `Browser.Browse()` has been enhanced to allow and disallow a variety of scenarios to avoid opening or executing files on the filesystem without unduly impacting HTTP URLs:\n\n1. URLs with `http://`, `https://`, `vscode://`, `vscode-insiders://` protocols are supported\n1. URLs with `file://` protocol are unsupported\n1. URLs matching files or directories on the filesystem are unsupported\n1. URLs matching executables in the user's path are unsupported\n\nURLs without protocols will be browsable if none of these other conditions apply.\n\nAs we have more information about use cases, maintainers can expand these capabilities for an improved user experience that allows configuring allowed URL schemes and/or prompt the user for an unexpected user case and confirming whether to continue.\n\n### Impact\n\nSuccessful exploitation could cause users of the attacker-controlled GitHub Enterprise Server to execute arbitrary commands.\n\n### Remediation and Mitigation\n\n1. Upgrade `go-gh` to `2.12.1`",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/cli/go-gh/v2"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.12.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/cli/go-gh/security/advisories/GHSA-g9f5-x53j-h563"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-48938"
}, {
"type" : "WEB",
"url" : "https://github.com/cli/go-gh/commit/a08820a13f257d6c5b4cb86d37db559ec6d14577"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/cli/go-gh"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-501" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2025-05-30T15:30:39Z",
"nvd_published_at" : "2025-05-30T19:15:29Z"
}
}