CVE-2021-32640

ReDoS in Sec-Websocket-Protocol header

MEDIUM
5.3
CVSS Score
Published: May 25, 2021 at 06:25 PM UTC
Updated: June 17, 2026 at 03:53 AM UTC
3 products affected across 3 vendorsE Series Performance AnalyzerWsWs

Using ws by websockets?

Get instant alerts when new vulnerabilities affect ws - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM5.3
Exploit prediction
EPSS 3%

Description

ws is an open source WebSocket client and server library for Node.js. A specially crafted value of the `Sec-Websocket-Protocol` header can be used to significantly slow down a ws server. The vulnerability has been fixed in [email protected] (https://github.com/websockets/ws/commit/00c425ec77993773d823f018f64a5c44e17023ff). In vulnerable versions of ws, the issue can be mitigated by reducing the maximum allowed length of the request headers using the [`--max-http-header-size=size`](https://nodejs.org/api/cli.html#cli_max_http_header_size_size) and/or the [`maxHeaderSize`](https://nodejs.org/api/http.html#http_http_createserver_options_requestlistener) options.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

5.0.0 ≤ v < 6.2.27.0.0 ≤ v < 7.4.6
Affected range stops below 6.2.2, so it looks safe — our inference, not a vendor statement
Affected range stops below 7.4.6, so it looks safe — our inference, not a vendor statement
v ≤ 7.4.5

Remediation

No guide yet

No remediation guidance has been written for this CVE yet. What the record does show:

CVSS

5.3MEDIUMGitHub_M
Attack Vector
NETWORK
Complexity
LOW
Privileges
NONE
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
NONE
Integrity
NONE
Availability
LOW
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-400

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card