CVE-2026-64653: Github.com/cli/cli/v2 Path Traversal Vulnerability

LOW
Advisory Identifier: GHSA-4fjg-2h4q-fwg3
CWE-22
Published
Advisory Summary

CVE-2026-64653 is a LOW path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Github.com/cli/cli/v2 libraries in the Go ecosystem. The issue involves github cli allows path traversal through unescaped request url components. Remediation is available by upgrading affected packages to version 2.97.0.

CVE-2026-64653 at a Glance

CVE Identifier CVE-2026-64653
GHSA Identifier GHSA-4fjg-2h4q-fwg3
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Github.com/cli/cli/v2
Package Ecosystem Go
Published Date
Last Updated

How to Fix CVE-2026-64653

To remediate this vulnerability, upgrade all affected Github.com/cli/cli/v2 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/cli/cli/v2 fixed: 2.97.0
Upgrade github.com/cli/cli/v2 to 2.97.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/cli/cli/v2

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-64653, inspect your project dependencies for Github.com/cli/cli/v2:

inspect dependencies for github.com/cli/cli/v2

Analyze the terminal output to locate any version of Github.com/cli/cli/v2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.97.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Github.com/cli/cli/v2, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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.

CVE-2026-64653 Affected Github.com/cli/cli/v2 Versions

1 component(s)
Fixed Versions:
2.97.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/cli/cli/v2
Go
< 2.97.0
2.97.0

References

Frequently Asked Questions

What is CVE-2026-64653?
CVE-2026-64653 is a security vulnerability in Github.com/cli/cli/v2 involving GitHub CLI allows path traversal through unescaped request URL components under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Github.com/cli/cli/v2 versions are affected?
Affected versions include releases prior to 2.97.0 across affected packages: github.com/cli/cli/v2.
What version fixes CVE-2026-64653?
Upgrading to 2.97.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/cli/cli/v2 affected?
Yes, github.com/cli/cli/v2 is affected in releases prior to 2.97.0. Upgrade your dependency to 2.97.0 or later.
What CWE is associated with CVE-2026-64653?
CVE-2026-64653 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check Go dependencies for CVE-2026-64653?
Run the dependency tree command: 'inspect dependencies for github.com/cli/cli/v2'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-4fjg-2h4q-fwg3",
  "modified" : "2026-10-15T18:07:15Z",
  "published" : "2026-10-15T18:07:14Z",
  "aliases" : [ "CVE-2026-64653" ],
  "summary" : "GitHub CLI allows path traversal through unescaped request URL components",
  "details" : "### Summary\n\nA 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.\n\n### Details\n\nNot 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.\n\nIn `2.97.0`, request URLs are constructed in a safe manner, so a variable component can no longer escape its intended segment.\n\n### Impact\n\nAn 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.\n\n### Remediation and Mitigation\n\n1. Upgrade `gh` to `2.97.0`.\n2. Be cautious when running `gh` against untrusted repositories or inputs whose names you do not control.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/cli/cli/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.97.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/cli/cli/security/advisories/GHSA-4fjg-2h4q-fwg3"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-64653"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cli/cli/commit/0c2eea6338a2323cfff000160b9b5a56a38d2a06"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/cli/cli"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cli/cli/releases/tag/v2.97.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-10-15T18:07:14Z",
    "nvd_published_at" : "2026-08-06T22:18:13Z"
  }
}