CVE-2026-64653 in GitHub
Summary
by MITRE • 08/07/2026
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.
If you want to get the best quality for vulnerability data then you always have to consider VulDB.
Analysis
by VulDB Data Team • 08/07/2026
The GitHub CLI tool represents a critical interface for developers interacting with GitHub's platform through command line operations, making it a prime target for sophisticated attack vectors. This vulnerability affects versions prior to 2.97.0 where the tool fails to properly implement percent encoding when constructing HTTP request URLs that incorporate user-controlled variables. The flaw specifically manifests in how path components are interpolated into request URLs, creating opportunities for path manipulation attacks that can redirect the tool's requests to unintended destinations within GitHub's API infrastructure.
The technical implementation of this vulnerability stems from improper input sanitization and URL construction practices within the CLI's HTTP request handling mechanisms. When users provide repository names, file paths, or other resource identifiers that contain special characters such as forward slashes, backslashes, or other path metacharacters, the tool fails to properly encode these values before incorporating them into the final request URL. This omission allows attackers to inject malicious path components that alter the intended API endpoint destination, potentially redirecting requests to different resources or endpoints than those originally specified by the user.
The operational impact of this vulnerability extends beyond simple request redirection, as it creates potential pathways for various attack scenarios including unauthorized access to resources, data exfiltration, and API abuse. An attacker could exploit this flaw to make the CLI tool interact with unintended API endpoints, potentially accessing repositories or resources they should not have access to, or manipulating API calls in ways that could compromise system integrity. The vulnerability particularly affects operations involving repository management, file access, and resource manipulation where user input directly influences URL construction.
This issue aligns with CWE-116, which addresses improper encoding of data within a string, and represents a classic example of path traversal vulnerability in command line tools that interact with web APIs. The flaw falls under the ATT&CK technique T1059.006 for Command and Scripting Interpreter and T1566.002 for Phishing via Social Media, as attackers could leverage this weakness to manipulate CLI operations for unauthorized access or data manipulation. Mitigation efforts should focus on implementing proper URL encoding mechanisms, validating all user inputs before URL construction, and ensuring that all path components are properly percent-encoded to prevent metacharacter injection attacks.
The fix implemented in version 2.97.0 addresses the core issue by enforcing proper percent encoding of all variable path components within HTTP request URLs. This update ensures that any special characters in repository names, file paths, or other user-controlled inputs are correctly encoded before being incorporated into API requests. Organizations should immediately upgrade to this patched version and implement monitoring for potential exploitation attempts. Security teams should also conduct thorough testing to verify that all CLI operations involving external resource access properly handle input validation and URL construction without exposing similar encoding vulnerabilities in their deployment environments.