You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The /_ws_tunnel endpoint in crates/openshell-server/src/ws_tunnel.rs (lines 42–51) accepts WebSocket upgrades without any authentication. The handler immediately upgrades the connection and pipes raw TCP bytes into the MultiplexService, granting the WebSocket client the same access as a direct mTLS client — full gRPC and HTTP access.
This completely bypasses mTLS client certificate verification. Any client that can reach the /_ws_tunnel endpoint can establish a WebSocket connection and send arbitrary gRPC/HTTP requests through it.
Impact
Severity: High
In practice, this endpoint is designed to sit behind a Cloudflare edge proxy that handles authentication. However, if the server is directly exposed (or the edge proxy is misconfigured), this is a full authentication bypass.
An attacker could create sandboxes, execute commands, delete resources, and access credentials.
Reproduction
Start a gateway with --disable-gateway-auth or with the WS tunnel exposed
Connect to ws://<host>:<port>/_ws_tunnel with no credentials
Send gRPC frames through the WebSocket — all RPCs are accessible
Proposed Fix
Add bearer token or JWT validation in the WebSocket upgrade handler before accepting the connection. At minimum, require and validate the cf-access-jwt-assertion header on the upgrade request.
sequenceDiagram
participant Attacker
participant Server as Gateway Server
participant WS as /_ws_tunnel
participant Multiplex as MultiplexService
Attacker->>Server: WebSocket upgrade (no creds)
Server->>WS: ws_tunnel_handler()
Note over WS: No auth check ❌
WS->>Multiplex: duplex stream
Attacker->>Multiplex: gRPC CreateSandbox
Multiplex->>Attacker: Sandbox created
This is a unique situation supporting CloudFlare tunnels. In our current single-user mode this presents a mode of using gRPC that is already available to clients. This will be addressed when we move to multi-tenant development.
Activity
johntmyers commentedon Mar 24, 2026
This is a unique situation supporting CloudFlare tunnels. In our current single-user mode this presents a mode of using gRPC that is already available to clients. This will be addressed when we move to multi-tenant development.