MEDIUM · CVSS 3.1 4.4 EPSS 0.3% · 26th percentile CWE-20CWE-829

CVE-2026-59831: GitHub CLI gh codespace jupyter may allow code execution via unvalidated URLs from malicious Codespaces

Published 2026-11-24 · Updated 2026-11-24 · Also known as GHSA-8cg3-r6g9-fpg2

Summary

The GitHub CLI suffers from a vulnerability in the `gh codespace jupyter` command where unvalidated URLs provided by a malicious Codespace can lead to remote code execution on the user's workstation. Developers using GitHub CLI and connecting to remote Codespaces should apply the available updates.

Who is affected

This flaw affects users running the `gh codespace jupyter` command against untrusted Codespaces. Successful exploitation requires the victim to connect to a malicious Codespace and accept a single VS Code prompt, which can lead to code execution via crafted `vscode://` URLs.

Exploitability

The vulnerability has a CVSS 3.1 base score of 4.4 (MEDIUM) with a vector of AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:N, indicating network accessibility with high attack complexity, low privileges required, and user interaction. The EPSS score is 0.003 (percentile 0.260), and it is not currently listed in the CISA Known Exploited Vulnerabilities catalog.

Remediation

How to check your project

Automated analysis of the published advisory data, generated 2026-11-25. Not human-reviewed; verify against the official advisory. How this works.

Affected packages

EcosystemPackageAffected versionsFixed inUpgrade
Go github.com/cli/cli/v2 >= 2.10.0, < 2.96.0 2.96.0 go get github.com/cli/cli/[email protected]

CVSS 3.1 vector

CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:N

Attack vectorNetwork
Attack complexityHigh
Privileges requiredLow
User interactionRequired
ScopeChanged
ConfidentialityLow
IntegrityLow
AvailabilityNone

FAQ

What causes the vulnerability?

The vulnerability is caused by the GitHub CLI failing to validate the server URL returned by a process inside a Codespace when running `gh codespace jupyter`, allowing malicious Codespaces to supply a crafted `vscode://` link instead of a web address.

What is required for successful exploitation?

An attacker needs a user to connect to a malicious Codespace using `gh codespace jupyter` and have the victim accept a VS Code 'open URL' or Workspace Trust prompt.

How is this related to CVE-2024-52308?

This is a variant of CVE-2024-52308, which previously fixed similar validation issues in the `gh codespace ssh` and `gh codespace logs` commands while omitting the Jupyter code path.

Original advisory 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.

References

Source records: GHSA-8cg3-r6g9-fpg2 (OSV.dev) · EPSS by FIRST, 2026-11-25.