Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2026-72924

CVE-2026-72924: GitHub CLI SSRF Vulnerability

CVE-2026-72924 is a server-side request forgery vulnerability in GitHub CLI that exposes forwarded Codespace ports to local network interfaces, allowing network-adjacent attackers to access services. This article covers technical details, affected versions, impact, and mitigation.

Published:

CVE-2026-72924 Overview

CVE-2026-72924 affects the GitHub CLI (gh), GitHub's official command line tool. Versions 2.28.0 through 2.97.0 bind the local listener created by gh codespace ports forward to all available network interfaces by default. When port forwarding is active, a service running inside a Codespace becomes reachable through the user's non-loopback local IP addresses. Any host that can route to the user's machine can connect to the forwarded service, even when the Codespaces-side port remains private. The issue is tracked as CWE-668: Exposure of Resource to Wrong Sphere and is fixed in version 2.98.0.

Critical Impact

A network-adjacent attacker can access services forwarded from a Codespace through the victim's local IP address while gh codespace ports forward is active.

Affected Products

  • GitHub CLI (gh) version 2.28.0
  • GitHub CLI (gh) versions 2.28.0 through 2.97.0
  • Any operating system where the affected gh versions run (Windows, macOS, Linux)

Discovery Timeline

  • 2026-08-25 - CVE-2026-72924 published to the National Vulnerability Database
  • 2026-08-26 - Entry last updated in NVD

Technical Details for CVE-2026-72924

Vulnerability Analysis

The gh codespace ports forward command establishes a tunnel between a Codespace and the local workstation. On affected versions, the local listener binds to the wildcard address (0.0.0.0 or ::) rather than the loopback interface. This behavior exposes the tunneled service on every network interface reachable from the host. Users who expect the forwarded port to remain local receive no warning that other systems on the same network segment can reach it.

The Codespace-side visibility of the port is unchanged. A port marked private in GitHub remains private, but its local projection through the CLI is world-accessible on the user's LAN. The exposure window lasts only while the forwarding session runs, and the attacker must be network-adjacent to the victim's machine.

Root Cause

The root cause is an insecure default in the port forwarding implementation. The listener is created with a wildcard bind address instead of restricting the socket to 127.0.0.1 or ::1. This maps to [CWE-668], where a resource intended for a restricted trust boundary is exposed to a broader sphere. Version 2.98.0 changes the default bind behavior to constrain the listener to the loopback interface.

Attack Vector

Exploitation requires an attacker on the same broadcast domain or otherwise routable network as the victim. The attacker connects to the victim's non-loopback IP address on the forwarded port while gh codespace ports forward is running. Any authentication, session state, or data exposed by the forwarded service becomes available. The attack does not touch GitHub infrastructure and generates no server-side signal on the Codespace itself. Refer to the GitHub Security Advisory GHSA-vfhh-p7hm-pxfh for the advisory details.

Detection Methods for CVE-2026-72924

Indicators of Compromise

  • Unexpected inbound TCP connections from LAN peers to ports opened by the gh process on non-loopback interfaces.
  • Listening sockets owned by the gh binary bound to 0.0.0.0 or :: on developer workstations.
  • Access log entries in Codespace-hosted services showing source addresses that are not 127.0.0.1.

Detection Strategies

  • Enumerate active listeners on developer machines with netstat -ano, ss -tlnp, or lsof -iTCP -sTCP:LISTEN and flag gh-owned sockets bound to wildcard addresses.
  • Query installed gh versions across the fleet and identify hosts running versions 2.28.0 through 2.97.0.
  • Correlate host-based firewall deny events with the gh process to surface adjacent scanning activity.

Monitoring Recommendations

  • Monitor endpoint telemetry for gh codespace ports forward command executions and record the ports opened.
  • Alert on inbound connections to developer workstations from non-loopback sources during active forwarding sessions.
  • Track software inventory changes to ensure gh is upgraded to 2.98.0 or later across all endpoints.

How to Mitigate CVE-2026-72924

Immediate Actions Required

  • Upgrade GitHub CLI to version 2.98.0 or later on all developer workstations and build agents.
  • Terminate any active gh codespace ports forward sessions running on vulnerable versions until the upgrade completes.
  • Audit developer endpoints for gh-owned listeners bound to wildcard interfaces.

Patch Information

The fix ships in GitHub CLI release v2.98.0. Version 2.98.0 constrains the local listener to the loopback interface by default. Install via the package manager appropriate for the platform (brew upgrade gh, winget upgrade GitHub.cli, or the distribution package repository).

Workarounds

  • Restrict developer workstations with host-based firewall rules that block inbound connections to ephemeral high ports from LAN peers.
  • Operate on trusted networks only while port forwarding sessions are active, and avoid public or shared Wi-Fi.
  • Use SSH tunneling or another loopback-bound forwarding mechanism until the CLI upgrade is deployed.
bash
# Upgrade GitHub CLI to the fixed release
# macOS
brew update && brew upgrade gh

# Windows
winget upgrade --id GitHub.cli

# Debian / Ubuntu
sudo apt update && sudo apt install --only-upgrade gh

# Verify version is 2.98.0 or later
gh --version

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.