---
title: "CWE-1385: Missing Origin Validation in WebSockets"
url: https://radicalnotion.ai/cwe/cwe-1385
type: cwe
description: "The product uses a WebSocket, but it does not properly verify that the source of data or communication is valid."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-1385: Missing Origin Validation in WebSockets

- **Abstraction:** Variant
- **Structure:** Simple
- **Status:** Incomplete
- **CVEs with this as primary weakness:** 45
- **Of those, in CISA KEV:** 0
- **New in 2026:** 25
- **CWE catalog version:** 4.21

## Description

The product uses a WebSocket, but it does not properly verify that the source of data or communication is valid.

## Background

WebSockets provide a bi-directional low latency communication (near real-time) between a client and a server. WebSockets are different than HTTP in that the connections are long-lived, as the channel will remain open until the client or the server is ready to send the message, whereas in HTTP, once the response occurs (which typically happens immediately), the transaction completes.

A WebSocket can leverage the existing HTTP protocol over ports 80 and 443, but it is not limited to HTTP. WebSockets can make cross-origin requests that are not restricted by browser-based protection mechanisms such as the Same Origin Policy (SOP) or Cross-Origin Resource Sharing (CORS).

## Alternate terms

- **Cross-Site WebSocket hijacking (CSWSH):** this term is used for attacks that exploit this weakness

## Modes of introduction

| Phase | Note |
| --- | --- |
| Architecture and Design | - |
| Implementation | - |

## Applicable platforms

**Languages:** Go (Undetermined)

**Technologies:** Web Based (Often), Web Server (Undetermined)

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Confidentiality, Integrity, Availability, Non-Repudiation, Access Control | Varies by Context, Gain Privileges or Assume Identity, Bypass Protection Mechanism, Read Application Data, Modify Application Data, DoS: Crash, Exit, or Restart | This makes CSRF attacks more powerful. The consequences will vary depending on the nature of the functionality that is vulnerable to CSRF. An attacker could effectively perform any operations as the victim. If the victim is an administrator or privileged user, the consequences may include obtaining complete control over the web application - deleting or stealing data, uninstalling the product, or using it to launch other attacks against all of the product's users. Because the attacker has the identity of the victim, the scope of the CSRF is limited only by the victim's privileges. |

## Potential 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.

Effectiveness: Defense in Depth

### Implementation

Use a library that provides restriction of the payload size. For example, WS library for Node includes 'maxPayloadoption' that can be set.

Effectiveness: Defense in Depth

### Implementation

Treat data/input as untrusted in both directions and apply the same data/input sanitization as XSS, SQLi, etc.

## Observed examples

| CVE | Description |
| --- | --- |
| 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. |

## Real CVEs with this weakness (sample of 12 of 45)

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2023-30856 | eDEX-UI cross-site websocket hijacking vulnerability enables remote command execution | critical | 10.0 | - | No | 2023-04-28 |
| CVE-2024-23168 | - | critical | 9.8 | - | No | 2024-08-15 |
| CVE-2014-125071 | lukehutch Gribbit HttpRequestHandler.java messageReceived missing origin validation in websockets | critical | 9.8 | - | No | 2023-01-09 |
| CVE-2025-24964 | Remote Code Execution when accessing a malicious website while Vitest API server is listening | critical | 9.7 | - | No | 2025-02-04 |
| CVE-2023-0957 | - | critical | 9.6 | - | No | 2023-03-03 |
| CVE-2026-85183 | Taipy through 4.1.1 Cross-Site WebSocket Hijacking via Wildcard socket.io CORS | critical | 9.3 | - | No | 2026-09-03 |
| CVE-2026-35589 | nanobot: Cross-Site WebSocket Hijacking in WhatsApp Bridge (CVE-2026-2577 Fix Update) | critical | 9.3 | - | No | 2026-04-14 |
| CVE-2023-26114 | code-server vulnerable to Missing Origin Validation in WebSockets | critical | 9.3 | - | No | 2023-03-23 |
| CVE-2026-10054 | - | high | 8.8 | - | No | 2026-07-03 |
| CVE-2025-52882 | Claude Code IDE extensions allow websocket connections from arbitrary origins | high | 8.8 | - | No | 2025-06-24 |
| CVE-2024-48849 | Authentication and Authorization Issues | high | 8.8 | - | No | 2025-01-29 |
| CVE-2023-49805 | Uptime Kuma Missing Origin Validation in WebSockets | high | 8.8 | - | No | 2023-12-11 |

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-346](https://radicalnotion.ai/cwe/cwe-346) | Origin Validation Error |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| OWASP Golang Secure Coding Practices Guide | Communication Security | - | - |

## Frequently asked questions

### What is CWE-1385?

The product uses a WebSocket, but it does not properly verify that the source of data or communication is valid.

### What CVEs are caused by CWE-1385?

45 recorded CVEs are attributed to CWE-1385, including CVE-2023-30856, CVE-2024-23168 and CVE-2014-125071.

### Is CWE-1385 part of the OWASP Top 10?

CWE-1385 maps to OWASP Golang Secure Coding Practices Guide: Communication Security in the OWASP security taxonomy.

### How do you prevent CWE-1385?

Enable CORS-like access restrictions by verifying the 'Origin' header during the WebSocket handshake.

### What are the consequences of CWE-1385?

Exploiting CWE-1385 can lead to: Varies by Context, Gain Privileges or Assume Identity, Bypass Protection Mechanism, Read Application Data, Modify Application Data, DoS: Crash, Exit, or Restart.

### Is CWE-1385 actively exploited?

45 recorded CVEs are caused by CWE-1385; none are currently in CISA's KEV catalog of actively exploited flaws.

Primary source: [MITRE CWE](https://cwe.mitre.org/data/definitions/1385.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/cwe/cwe-1385). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
