CWE-1385: Missing Origin Validation in WebSockets

CWE-1385 là gì?

CWE-1385 là Missing Origin Validation in WebSockets. Lỗi phát sinh khi The product uses a WebSocket, but it does not properly verify that the source of data or communication is valid. Hiện có 24 lỗ hổng trong kho dữ liệu liên quan đến CWE-1385 và không có lỗ hổng nào nằm trong danh mục khai thác thực tế của CISA.

Thứ hạng OWASP Top 10-
Tổng số CVE liên quan (365 ngày)24
Mức trừu tượngBiến thể
Khả năng khai thác-

Số lượng lỗ hổng nằm trong CWE-1385

24 lỗ hổngTăng 167% so với cùng kỳ

Không có dữ liệu

Chưa có dữ liệu về lỗ hổng trong CISA KEV cho CWE-1385

Định nghĩa chính thức

TheoMitre CWE

Đặc điểm

Dữ liệu MITRE CWE chính thức

Tên gọi khác

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

Giai đoạn hình thành

  • Kiến trúc và thiết kế
  • Hiện thực hóa

Hậu quả thường gặp

Dữ liệu MITRE CWE chính thức
Tác độngPhạm viDiễn giải
Thay đổi tùy ngữ cảnh, Chiếm đặc quyền hoặc mạo danh, Vượt qua cơ chế bảo vệ, Đọc dữ liệu ứng dụng, Thay đổi dữ liệu ứng dụng, Từ chối dịch vụ: sập, thoát hoặc khởi động lạiTính bí mật, Tính toàn vẹn, Tính sẵn sàng, Chống chối bỏ, Kiểm soát truy cậpThis 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.

Biện pháp giảm thiểu rủi ro

Dữ liệu MITRE CWE chính thức
  1. Hiện thực hóaEnable CORS-like access restrictions by verifying the 'Origin' header during the WebSocket handshake.
  2. Hiện thực hóaUse a randomized CSRF token to verify requests.
  3. Hiện thực hóaUse TLS to securely communicate using 'wss' (WebSocket Secure) instead of 'ws'.
  4. Kiến trúc và thiết kế, Hiện thực hóaRequire user authentication prior to the WebSocket connection being established. For example, the WS library in Node has a 'verifyClient' function.
  5. Hiện thực hóa · Hiệu quả: Phòng thủ nhiều lớpLeverage rate limiting to prevent against DoS. Use of the leaky bucket algorithm can help with this.
  6. Hiện thực hóa · Hiệu quả: Phòng thủ nhiều lớpUse a library that provides restriction of the payload size. For example, WS library for Node includes 'maxPayloadoption' that can be set.
  7. Hiện thực hóaTreat data/input as untrusted in both directions and apply the same data/input sanitization as XSS, SQLi, etc.

Lỗ hổng điển hình

Nguồn (2)

CWE™ Program, operated by The MITRE Corporation. Copyright © 2006–2026, The MITRE Corporation. The MITRE Corporation hereby grants you a non-exclusive, royalty-free license to use CWE for research, development, and commercial purposes. CWE Terms of Use.

Tìm hiểu thêm

Kiểm tra chuyên sâu cùng giải pháp quản lý rủi ro Web toàn diện

Giải pháp CyStack VulnScan liên tục phát hiện tài sản, xác minh lỗ hổng và giúp đội ngũ bảo mật ưu tiên khắc phục cho toàn bộ doanh nghiệp.