All vulnerabilities

Go

CVE-2026-59831

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

Severity
Medium 4.4
Published
24 Nov 2026
Last changed
24 Nov 2026
Added to UpHeron
24 Nov 2026
Fixed in
2.96.0
Exploit chance
0.3% in the next 30 daysHigher than 25% of CVEs. EPSS by FIRST, 24 Nov 2026
Weakness
Improper input validation (CWE-20)CWE-829
Attack
Over the network · Only under certain conditions · Needs a user account · Needs someone to click or open something
Attacker can
Read some data · Change some data
CVSS vector
CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:N
Also known as
GHSA-8cg3-r6g9-fpg2
Sources
OSV.dev and GitHub

Description

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. That remediation validated the SSH connection details for gh codespace ssh and gh codespace logs, but did not cover the equivalent Jupyter code path.

The vulnerability stems from the way GitHub CLI handles the server URL returned when starting a remote JupyterLab server:

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Workarounds

  • Upgrade gh to v2.96.0.
  • Exercise caution when using gh codespace jupyter with untrusted Codespaces. Prefer Codespaces created from trusted sources, and prefer default or pre-built devcontainers.
Workarounds as given by the GitHub Advisory Database, CC BY 4.0.

Affected software

SoftwareAffected versions
github.com/cli/cli/v2Go · osv:Go:github.com/cli/cli/v2
  • From 2.10.0 before 2.96.0

About github.com/cli/cli/v2

This is the only vulnerability in github.com/cli/cli/v2 in our list.

References