Skip to content
FlawDB
Sign in

CVE-2026-59831

MEDIUM 4.4EPSS 18%

GitHub CLI gh codespace jupyter may allow code execution via unvalidated URLs from malicious Codespaces

Also known as GHSA-8cg3-r6g9-fpg2

Mitigation

  • Upgrade github.com/cli/cli/v2 to 2.96.0 or later.

Who should check

  • Projects that depend on Go package github.com/cli/cli/v2 (>= 2.10.0, < 2.96.0)

Vulnerability facts

Affected
github.com/cli/cli/v2 >= 2.10.0, < 2.96.0
Fixed in
2.96.0
Exploited in the wild
Not in CISA KEV
Public exploit / PoC
None known
Remote exploitation
Remote, login needed
CVSS
4.4 (v3.1, GitHub)CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:NOpen in CVSS calculator
Show all 8 CVSS metrics
  • Attack vector: Network
  • Attack complexity: High
  • Privileges required: Low
  • User interaction: Required
  • Scope: Changed (impact reaches other components)
  • Confidentiality impact: Low
  • Integrity impact: Low
  • Availability impact: None
EPSS
0.33% chance of exploitation in 30 days (percentile 18, 2026-11-26)
CWE
CWE-20, CWE-829
Published
Modified

Description

### Summary A security vulnerability has been identified in GitHub CLI that could allow remote code execution when users connect to a malicious Codespace using the `gh codespace jupyter` command. The command opens JupyterLab by launching a URL in the user's browser, but that URL is supplied by a process running inside the Codespace and the CLI opens it without validating it. The browser launcher accepts `vscode://` and `vscode-insiders://` links, so a malicious Codespace can return a crafted `vscode://` URL. The CLI opens the link, the operating system hands it to VS Code, and VS Code acts on it, which can lead to code execution on the user's workstation. This is a variant of [CVE-2024-52308](https://github.com/advisories/GHSA-p2h2-3vg9-4p87). That remediation validated the SSH connection details for `gh codespace ssh` and `gh codespace logs`, but did not cover the equivalent Jupyter code path. ### Details The vulnerability stems from the way GitHub CLI handles the server URL returned when starting a remote JupyterLab server: 1. A user runs `gh codespace jupyter -c <name>`, expecting a normal `https://` JupyterLab page. 2. The CLI retrieves a server URL from a process inside the Codespace and opens it in the user's browser without confirming that it is a web address. 3. A malicious Codespace returns a `vscode://` link in place of the expected JupyterLab address. The operating system passes the link to VS Code. 4. VS Code acts on the link. With a single trust prompt, this can result in code execution on the user's workstation. The CLI trusts the URL provided by the Codespace and opens it as-is, without confirming that it is a loopback JupyterLab web address. The equivalent SSH commands received this validation in the CVE-2024-52308 fix, but the Jupyter command was not covered. In `v2.96.0`, the GitHub CLI validates the Jupyter server URL before opening it, accepting only loopback `http` and `https` addresses. ### Impact Any user who runs `gh codespace jupyter` against an untrusted Codespace. Successful exploitation requires the victim to accept one VS Code "open URL" or Workspace Trust prompt. ## Remediation and Mitigation 1. Upgrade `gh` to `v2.96.0`. 2. Exercise caution when using `gh codespace jupyter` with untrusted Codespaces. Prefer Codespaces created from trusted sources, and prefer default or pre-built devcontainers.

Affected and fixed versions

Package / productAffectedFixedSource
Go github.com/cli/cli/v2>= 2.10.0, < 2.96.02.96.0ghsa

Check your systems with an agent

Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.

Check whether anything I run is affected by CVE-2026-59831. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-59831.md
Affected: github.com/cli/cli/v2 >= 2.10.0, < 2.96.0
Fixed in: 2.96.0

Steps:
1. Search this machine and project for github.com/cli/cli/v2 (Go): dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.

Technologies

References

FAQ

Is CVE-2026-59831 being exploited?

There is no confirmed exploitation: CVE-2026-59831 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.33% chance of exploitation in the next 30 days (as of 2026-11-26).

How serious is CVE-2026-59831?

Medium: CVSS 4.4 (v3.1, scored by GitHub). Remote, login needed. A user has to take an action, such as opening a link, for the attack to work. The attack needs conditions outside the attacker's control, which makes it harder.

Which versions are affected by CVE-2026-59831?

github.com/cli/cli/v2 >= 2.10.0, < 2.96.0.

Is there a fix for CVE-2026-59831?

Yes. Fixed in 2.96.0. Upgrade github.com/cli/cli/v2 to 2.96.0 or later.

How do I check if I'm affected by CVE-2026-59831?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

Sponsors