Weakness (CWE)
CWE-1385: Missing Origin Validation in WebSockets
The product uses a WebSocket, but it does not properly verify that the source of data or communication is valid.
How to prevent it (7 mitigations)
-
Implementation
Enable CORS-like access restrictions by verifying the 'Origin' header during the WebSocket handshake.
-
Implementation
Use a randomized CSRF token to verify requests.
-
Implementation
Use TLS to securely communicate using 'wss' (WebSocket Secure) instead of 'ws'.
-
Architecture and Design, Implementation
Require user authentication prior to the WebSocket connection being established. For example, the WS library in Node has a 'verifyClient' function.
-
Implementation
Leverage rate limiting to prevent against DoS. Use of the leaky bucket algorithm can help with this.
-
Implementation
Use a library that provides restriction of the payload size. For example, WS library for Node includes 'maxPayloadoption' that can be set.
-
Implementation
Treat data/input as untrusted in both directions and apply the same data/input sanitization as XSS, SQLi, etc.
Source: MITRE CWE-1385
2 results · Clear filters · Feed
-
High 7.1CVE-2025-68930 Public exploit
Traccar Missing Origin Validation in WebSockets
Versions of the Traccar open-source GPS tracking system up to and including 6.11.1 contain a Cross-Site WebSocket Hijacking (CSWSH) vulnerability in the `/api/socket` endpoint. The application fails to validate the `Origin` header during the WebSocket handsha…
-
High 8.3CVE-2023-30856 Public exploit
eDEX-UI cross-site websocket hijacking vulnerability enables remote command execution
eDEX-UI is a science fiction terminal emulator. Versions 2.2.8 and prior are vulnerable to cross-site websocket hijacking. When running eDEX-UI and browsing the web, a malicious website can connect to eDEX's internal terminal control websocket, and send arbit…