Binding to an Unrestricted IP Address Affecting github.com/cli/cli/v2/pkg/cmd/codespace package, versions >=2.28.0 <2.98.0


Severity

Recommended
0.0
low
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.18% (8th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-GOLANG-GITHUBCOMCLICLIV2PKGCMDCODESPACE-19276668
  • published27 Aug 2026
  • disclosed26 Aug 2026
  • creditUnknown

Introduced: 26 Aug 2026

NewCVE-2026-72924  (opens in a new tab)
CWE-1327  (opens in a new tab)

How to fix?

Upgrade github.com/cli/cli/v2/pkg/cmd/codespace to version 2.98.0 or higher.

Overview

Affected versions of this package are vulnerable to Binding to an Unrestricted IP Address through the ForwardPorts path in pkg/cmd/codespace/ports.go. An attacker can reach a forwarded Codespaces service from other hosts on the victim’s network by having the user run gh codespace ports forward, which binds the local listener to all interfaces instead of loopback. This exposes the forwarded port on the user’s non-loopback local IP addresses while forwarding is active, allowing network-adjacent access to whatever service is being forwarded.

Workarounds

  • Avoid running gh codespace ports forward on untrusted or shared networks, so the forwarded service is less likely to be reachable by other hosts that can route to your machine.
  • Use host firewall rules to block inbound access to the locally forwarded port, preventing network-adjacent hosts from connecting while forwarding is active.
  • Stop the forwarding process when it is no longer needed, which removes the exposed listener and closes the attack window.

CVSS Base Scores

version 4.0
version 3.1