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
- Upgrade github.com/cli/cli/v2 to version 2.96.0 or later.
- Exercise caution when using `gh codespace jupyter` with untrusted Codespaces, preferring those created from trusted sources.
How to check your project
- Check project dependency files or Go module lists for github.com/cli/cli/v2 versions introduced at 2.10.0 and prior to 2.96.0.
Automated analysis of the published advisory data, generated 2026-11-25. Not human-reviewed; verify against the official advisory. How this works.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | Upgrade |
|---|---|---|---|---|
| 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 vector | Network |
|---|---|
| Attack complexity | High |
| Privileges required | Low |
| User interaction | Required |
| Scope | Changed |
| Confidentiality | Low |
| Integrity | Low |
| Availability | None |
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
References
- WEB https://github.com/cli/cli/security/advisories/GHSA-8cg3-r6g9-fpg2
- ADVISORY https://nvd.nist.gov/vuln/detail/CVE-2026-59831
- WEB https://github.com/cli/cli/commit/b300f2ec7ec9dc9addc39b2ad88c54097ded7ca0
- PACKAGE https://github.com/cli/cli
- WEB https://github.com/cli/cli/releases/tag/v2.96.0
Source records: GHSA-8cg3-r6g9-fpg2 (OSV.dev) · EPSS by FIRST, 2026-11-25.