CWE-1385: Missing Origin Validation in WebSockets
42 CVEs have CWE-1385 as their primary weakness. 0 of them are in the CISA KEV catalog. The highest EPSS score among them is 0.916%.
The product uses a WebSocket, but it does not properly verify that the source of data or communication is valid.
Child of CWE-346: Origin Validation Error
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.
Observed examples
- CVE-2020-25095: web console for SIEM product does not check Origin header, allowing Cross Site WebSocket Hijacking (CSWH)
- CVE-2018-6651: Chain: gaming client attempts to validate the Origin header, but only uses a substring, allowing Cross-Site WebSocket hijacking by forcing requests from an origin whose hostname is a substring of the valid origin.
- CVE-2018-14730: WebSocket server does not check the origin of requests, allowing attackers to steal developer's code using a ws://127.0.0.1:3123/ connection.
- CVE-2018-14731: WebSocket server does not check the origin of requests, allowing attackers to steal developer's code using a ws://127.0.0.1/ connection to a randomized port number.
- CVE-2018-14732: WebSocket server does not check the origin of requests, allowing attackers to steal developer's code using a ws://127.0.0.1:8080/ connection.
Get more CVE data from the API.
curl 'https://api.contrastcyber.com/cwe_lookup/CWE-1385'curl 'https://api.contrastcyber.com/cve_search?cwe_id=CWE-1385'
Sources
- Vulnerability data from the National Vulnerability Database (NIST) and the CVE Program. CVE records: Copyright © 1999-2026, The MITRE Corporation, used under the CVE Program Terms of Use. CVE® is a registered trademark of The MITRE Corporation.
- CWE definitions: Copyright © 2006-2026, The MITRE Corporation, used under the CWE Terms of Use. CWE is a trademark of The MITRE Corporation.
- OWASP Top 10 categories by the OWASP Foundation (CC BY 3.0).
- EPSS scores by FIRST.org EPSS, used with attribution.
- KEV catalog and SSVC decisions by CISA.
- Advisory data from the GitHub Advisory Database through OSV.dev (CC BY 4.0).
- Exploit metadata from the Exploit Database (GPL-2.0-only, metadata only).
- Nuclei template names from nuclei-templates (MIT).