LiveActive security incident?Get immediate response
CVE Record

CVE-2021-32640: ReDoS in Sec-Websocket-Protocol header

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 ws@7.4.6 (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.

MediumCVSS 5.3Not KEV-listedUpdated
Glexia's TakeAutomated analysismoderate

Security readout for executives and security teams

Plain-English summary

CVE-2021-32640 affects the Node.js ws WebSocket library. A malformed Sec-Websocket-Protocol request header can make a vulnerable server slow down significantly. The business impact is service availability, not data theft or tampering. Public-facing WebSocket services using ws versions 5.0.0 through 7.4.5 deserve timely remediation.

Executive priority

Treat as a moderate availability risk. Prioritize externally reachable WebSocket services and high-traffic systems, then remediate internal deployments through normal patch cycles. No source in the bundle supports emergency response for active exploitation.

Technical view

The issue is a ReDoS-style resource consumption flaw in ws header handling, tracked as CWE-400. It is network reachable, needs no authentication or user interaction, and has CVSS 5.3. Affected versions are ws >=5.0.0 through <=7.4.5. The cited fix is ws 7.4.6.

Likely exposure

Exposure is most likely in Node.js applications, appliances, or downstream products that bundle ws and accept WebSocket upgrade requests. Internet-facing WebSocket endpoints have the highest operational risk. Internal-only services still matter if untrusted clients can reach them.

Exploitation context

The bundle does not cite active exploitation, and KEV is false. The flaw is plausible to trigger remotely because it is unauthenticated and in request-header processing, but available evidence supports limited availability impact rather than compromise of data or control.

Researcher notes

The key research focus is dependency reachability: whether vulnerable ws code is present and exposed to untrusted WebSocket handshakes. Avoid assuming impact for products merely because Node.js is present; confirm ws version and runtime path.

Mitigation direction

  • Upgrade ws to 7.4.6 or a vendor-supported fixed release.
  • Reduce maximum allowed HTTP request header length where upgrade is delayed.
  • Use Node --max-http-header-size where appropriate.
  • Use server maxHeaderSize options where appropriate.
  • Check downstream vendor advisories for bundled ws fixes.

Validation and detection

  • Inventory package-lock, yarn.lock, pnpm-lock, and SBOMs for ws versions 5.0.0 through 7.4.5.
  • Identify applications accepting WebSocket upgrade requests.
  • Confirm deployed runtime images include the remediated dependency.
  • Review HTTP header size limits on affected Node.js services.
  • Track vendor advisories for products embedding ws.
Prepared
Confidence
high
Sources
6

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · low confidence lookup

CWE-400: Exact CWE lookup

Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2021-32640 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
Medium
CVSS
5.3 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

1CVSS vectors
0Timeline events
0ADP providers
5Source links

CVSS vector scores

1 official score

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
5.3CVSS 3.1MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L3.91.4Primary CVE score

Vulnerability scoring details

Base CVSS 3.1 score

5.3Medium
CVSS 3.1 vector shape for CVE-2021-32640Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Privileges Required
NoneLowHigh
User Interaction
NoneRequired
Scope
ChangedUnchanged
Confidentiality Impact
HighLowNone
Integrity Impact
HighLowNone
Availability Impact
HighLowNone
Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
websocketsws>= 5.0.0 <= 7.4.5Listed
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.

CWE-400 · source CWE mapping

Uncontrolled Resource Consumption

Uncontrolled Resource Consumption represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.