NIST deprecates RSA-2048 from 2030. Find every one of them before attackers do.
🐹
🐹 Go
Not in CISA KEV
MEDIUM severity

CVE-2026-59831 — cli

MEDIUMFix: cli/cli@b300f2e

CVE-2026-59831 is a medium-severity (CVSS 4.4) CWE-829 vulnerability in github.com/cli/cli/v2. A fix is available for github.com/cli/cli/v2 — see the affected versions and patch details below.

GitHub CLI `gh codespace jupyter` could allow remote code execution when connecting to a malicious Codespace

Also known asGHSA-8cg3-r6g9-fpg2
Published
Updated
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed
Exploitation data as of Nov 23, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Exploitation Status

No confirmed exploitation observed yet

  • CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.

Exploitation and automatability from CISA’s SSVC triage for CVE-2026-59831.

EPSS Exploitation Probability

via FIRST.org ↗
0.3%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs26th percentile — riskier than 26% of all scored CVEsHighest risk
0.00%0.28%0.55%0.83%0.3%0.3%0.3%0.3%0.3%Aug 26Oct 26Nov 26

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

How urgent is this, really

Where this sits among everything scored

Real-World Exposure

1 pkg affected
🐹github.com/cli/cli/v2

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.

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. 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 Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
🐹Gogithub.com/cli/cli/v2≥ 2.10.0&&< 2.96.02.96.0go get github.com/cli/cli/v2@v2.96.0

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for github.com/cli/cli/v2, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update github.com/cli/cli/v2 to 2.96.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-59831 is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

Frequently Asked Questions

### 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 o
O3 Security · Impact-Aware SCA

Is CVE-2026-59831 in your dependencies?

Find it across Go, including transitive dependencies.

CVE-2026-59831: cli — Fixed in 2.96.0