Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Attacker requires no privileges (public repo); victim must actively run gh (UI:R); impact is scoped to the GitHub API (S:C) at low C/I with no local system impact.
Primary rating from Vendor (github).
CVSS VectorVendor: github
Lifecycle Timeline
4DescriptionCVE.org
GitHub CLI (gh) is GitHub’s official command line tool. Prior to 2.97.0, some HTTP request URLs interpolate variable path components without percent encoding, allowing URL path metacharacters in attacker-controlled repository or resource values to make gh address a different API endpoint or resource than the user intended. This issue is fixed in version 2.97.0.
AnalysisAI
URL path injection in GitHub CLI (gh) prior to version 2.97.0 allows attacker-controlled repository names or resource values containing URL path metacharacters to redirect the tool's REST API requests to unintended GitHub API endpoints. The root cause is that HTTP request paths are assembled via Go's fmt.Sprintf by interpolating untrusted values - such as repository owner, name, or branch - without percent-encoding, enabling path traversal through the API surface. No public exploit has been identified at time of analysis, and the vulnerability requires active user interaction with an attacker-controlled repository.
Technical ContextAI
GitHub CLI (cli/cli) is written in Go and constructs GitHub REST API request URLs by interpolating repository metadata (owner, name, branch) directly into path strings. The underlying flaw is CWE-22 (Improper Limitation of a Pathname to a Restricted Directory) expressed as URL path traversal: values containing metacharacters such as '/', '..', or their percent-encoded forms are embedded in API paths without sanitization, causing the resulting HTTP request to resolve a different endpoint than intended. The fix, confirmed by commit 0c2eea6, introduces an internal safeurl package enforcing that all HTTP requests route through safeurl.JoinPath for proper component encoding; a new ImmutableSafeURL type is restricted to pre-formed trusted URLs only, and two new CodeQL queries (ImmutableSafeURLConstruction.ql and SafeURLPathConstruction.ql) statically enforce these construction patterns across the codebase going forward. Affected versions are cli < 2.97.0 per EUVD-2026-54213.
RemediationAI
Upgrade GitHub CLI to version 2.97.0 or later; this is the vendor-released patch confirmed by the official release at https://github.com/cli/cli/releases/tag/v2.97.0 and the fix commit at https://github.com/cli/cli/commit/0c2eea6338a2323cfff000160b9b5a56a38d2a06. No workaround is documented by the vendor. As a compensating control, CI/CD pipelines that pass user-supplied or third-party repository names to gh commands should validate that those names conform to GitHub's allowed repository name characters (alphanumeric, hyphens, underscores, dots) and reject inputs containing '/', '%', or other URL metacharacters before passing them to the CLI - note this adds input-validation overhead and may require updates if GitHub ever permits additional characters.
Same weakness CWE-22 – Path Traversal
View allSame technique Path Traversal
View allVendor StatusVendor
SUSE
Severity: Moderate| Product | Status |
|---|---|
| openSUSE Tumbleweed | Fixed |
Share
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-54213