Executive brief
GitHub CLI is the official command-line interface for GitHub's platform. Prior to version 2.97.0, the tool could be tricked into accessing unintended API endpoints when repository or resource names contain special URL characters. An attacker could craft malicious repository names to redirect operations to different resources, potentially allowing unauthorized access or data manipulation through a user's authenticated session.
Technical details
The vulnerability is a path traversal / URL path injection flaw in GitHub CLI's HTTP request URL construction. Multiple commands interpolated variable path components (repository names, resource IDs, etc.) into REST API URLs without percent-encoding, allowing URL metacharacters to alter the request path and reach unintended API endpoints. The fix, released in version 2.97.0, introduced a SafeURL package that enforces percent-encoding of all variable components and rejects path-traversal patterns like ".." to prevent endpoint confusion attacks. The vulnerability requires user interaction—a user must execute a gh command that references an attacker-controlled repository or resource name.
Affected products
- GitHub CLI prior to 2.97.0
Timeline
- 2026-07-31: patched: Fixed in version 2.97.0