# Theia WebSocket Origin Validation Bypass Enables Terminal Command Execution

Theia's WebSocket origin check fails open and trusts a client-supplied fix-origin header, letting a malicious webpage open a shell terminal and run commands.

- Payout: Research
- Severity: high
- Program: Theia
- Found by (vendor credit): Anwar Ayoob
- Found by: AnwarAyoob
- Disclosed: 2026-12-03
- CVE: CVE-2026-10054
- Write-up quality: 7/10
- Original: https://github.com/advisories/GHSA-78g8-vm3p-97c6
- Library page: https://bugbountylibrary.com/r/ghsa%3AGHSA-78g8-vm3p-97c6
- Tags: area:web domain:web impact:rce kind:research platform:ghsa sev:high tech:nodejs tech:websocket technique:source-review vuln:access-control vuln:auth-bypass vuln:rce

**Target:** Theia browser backend WebSocket RPC (/services/shell-terminal, /services/terminals/:id)
**Root cause:** Origin validation in ws-origin-validator.ts is fail-open when Origin is absent or THEIA_HOSTS is unset, and websocket-endpoint.ts overwrites Origin with the attacker-controllable fix-origin header; terminal RPC services have no auth gate.
**Steps:**
1. From a foreign-origin page, connect to the `/services` Socket.IO namespace, supplying or omitting the `fix-origin` header to satisfy origin validation
2. Open the `shell-terminal` RPC channel and invoke terminal creation
3. Connect to the resulting `/services/terminals/:id` data channel
4. Send commands over the terminal channel and read output
**How found:** Code review of the WebSocket hosting layer: noticed origin validation fails open when Origin is missing or THEIA_HOSTS unset, and that the Socket.IO integration replaces the trusted Origin with a client-supplied fix-origin header.
**Exploitation:** A drive-by malicious webpage connects cross-origin to the Theia backend WebSocket, creates a shell terminal via the unauthenticated RPC, attaches to its data channel, and executes arbitrary commands, reading output back over the socket.
**Insight:** When auditing WebSocket RPC backends, check whether origin checks are fail-open on missing headers and whether any proxy/Socket.IO layer rewrites Origin from a client-controlled header like fix-origin; also check whether privileged RPC namespaces (terminal, shell) have service-level auth independent of origin.

