CVE-2026-64653: GitHub CLI allows path traversal through unescaped request URL components
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.
Published Oct 15, 2026
Affected packages
github.com/cli/cli/v2
- Ecosystem
- Go
- Affected
- < 2.97.0
- Fixed in
- 2.97.0
- Check
go list -m github.com/cli/cli/v2
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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
- Upgrade
ghto2.97.0. - Be cautious when running
ghagainst untrusted repositories or inputs whose names you do not control.
Credited to babakks, BagToad, helixplant, sam-kossey.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Go vulnerabilities
All Go entriesCVE-2026-64652
GitHub CLI partially discloses authentication tokens in `gh auth status` output
low3.3Oct 15, 2026CVE-2026-64655
GitHub CLI allows attestation verification bypass through unescaped regex metacharacters
low2.1Oct 15, 2026CVE-2026-48501
GitHub CLI has an incorrect authorization header in API requests to TUF repository mirrors via `gh attestation`, `gh release verify`, and `gh release verify-asset` commands
high7.4May 29, 2026CVE-2026-45803
GitHub CLI: GitHub Actions log output in `gh run view` allows terminal escape sequence injection
low3.5No fixMay 19, 2026CVE-2025-25204
`gh attestation verify` returns incorrect exit code during verification if no attestations are present
medium6.3Feb 14, 2025CVE-2024-54132
Downloading malicious GitHub Actions workflow artifact results in path traversal vulnerability
medium6.3No fixDec 4, 2024
