CVE-2023-26114: code-server vulnerable to Missing Origin Validation in WebSockets
9.3
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.16239%
CWE
Published
3/23/2023
Updated
3/27/2023
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| code-server | npm | < 4.10.1 | 4.10.1 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stemmed from missing origin validation in WebSocket handlers across multiple endpoints. The patch added 'ensureOrigin' checks to these routes, which: 1) validate() Origin header against Host/X-Forwarded headers 2) Handle Forwarded header parsing 3) Block requests with mismatched origins. The vulnerable versions lacked these checks in their WebSocket handlers, particularly visible in routes like domainProxy.ts (lines 78-86), pathProxy.ts (line 50), and vscode.ts (line 173) where WebSocket handlers were modified to add origin validation middleware. The absence of these checks in pre-4.10.1 versions allowed cross-origin WebSocket hijacking.