Project

General

Profile

Actions

Security #8586

closed
JI

websocket: MASK flag not validated by direction

Security #8586: websocket: MASK flag not validated by direction

Added by Jason Ish 17 days ago. Updated 5 days ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Target version:
-
Affected Versions:
Label:
CVE:
Git IDs:
Severity:
Disclosure Date:
05/19/2026
GHSA:

Description

  1. Summary

The WebSocket parser accepts any combination of MASK flag and direction. RFC 6455 section 5.1 requires client-to-server frames to be masked and server-to-client frames to not be masked.

  1. Affected Code

Files: `rust/src/websocket/parser.rs:48-97`, `rust/src/websocket/websocket.rs`

  1. Impact

This enables two evasion vectors:

1. A server injects masked frames with payload that a real browser would discard; Suricata de-XORs and feeds content to the detector that the client never processes.
2. A client sends unmasked frames; Suricata accepts what the real server would close with 1002 Protocol Error.

  1. Suggested Fix

Track connection direction and validate the mask flag accordingly.

  1. Environment

Suricata main branch @ commit 367ca7f (post v8.0.1, May 15, 2026).

  1. Credit

Reported by Chris Ramos.

JI Updated by Jason Ish 17 days ago Actions #1

  • Description updated (diff)
  • Severity deleted (MODERATE)
  • Disclosure Date set to 05/19/2026
  • Affected Versions deleted (git main)

PA Updated by Philippe Antoine 17 days ago Actions #2

  • Related to Bug #5279: nom: use of count combinator can use too much memory added

PA Updated by Philippe Antoine 17 days ago Actions #3

  • Related to deleted (Bug #5279: nom: use of count combinator can use too much memory)

PA Updated by Philippe Antoine 17 days ago Actions #4

I think it is good to have the relaxed parsing as now

JF Updated by Juliana Fajardini Reichow 11 days ago Actions #5

  • Status changed from New to Triaged

JF Updated by Juliana Fajardini Reichow 5 days ago Actions #6

  • Status changed from Triaged to Rejected
  • Assignee deleted (OISF Dev)
  • Target version deleted (TBD)

Rejecting as we understand that relaxed parsing is the way to go.

JF Updated by Juliana Fajardini Reichow 5 days ago Actions #7

  • Private changed from Yes to No
Actions

Also available in: PDF Atom