CVE-2026-64653: GitHub CLI: Unescaped variable components in request URLs could allow path traversal
Summary
A path traversal vulnerability has been identified in the GitHub CLI where some HTTP request URLs, REST API calls in particular, were built without properly escaping their variable path components. A value containing URL path metacharacters can alter the request path and cause gh to address a different resource than intended.
Details
Not all request URLs in the codebase were built with proper escaping of their variable path components. When a component is interpolated into the path without percent encoding, and that component contains URL path metacharacters, it breaks out of its intended segment and changes the effective request path.
In 2.97.0, request URLs are constructed in a safe manner, so a variable component can no longer escape its intended segment.
Impact
An attacker who can control a value that flows into a request path can cause gh to send the request to a different API endpoint than intended. This can lead the CLI to read or act on a resource other than the one the user meant to target.
Remediation and Mitigation
1. Upgrade gh to 2.97.0. 2. Be cautious when running gh against untrusted repositories or inputs whose names you do not control.
Other sources
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.
— MITRE
GitHub CLI: Unescaped variable components in request URLs could allow path traversal
— Microsoft
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 2.97.0-1 - Upgrade
Upgrade
go/github.com/cli/cli/v2to a version that resolves this vulnerability.Fixed in 2.97.0 - Upgrade
Upgrade
GitHub CLI (gh)to a version that resolves this vulnerability.Fixed in 2.97.0
Event History
Frequently Asked Questions
What is the severity of CVE-2026-64653?
The severity of CVE-2026-64653 is rated as risk 33.
How do I fix CVE-2026-64653?
To fix CVE-2026-64653, update the GitHub CLI (gh) to version 2.97.0 or higher.
What is CVE-2026-64653 about?
CVE-2026-64653 involves unescaped variable components in request URLs in GitHub CLI, which can allow path traversal.
Which versions of GitHub CLI are affected by CVE-2026-64653?
Versions of GitHub CLI prior to 2.97.0 are affected by CVE-2026-64653.
What type of vulnerability is CVE-2026-64653 classified as?
CVE-2026-64653 is classified as a Path Traversal vulnerability.