Skip to content
Fencer Vulns
medium 5.3

CVE-2021-32640 json

ReDoS in Sec-Websocket-Protocol header

published 2021-05-25 5 y ago modified 2026-07-08 4 mo ago also GHSA-6fc8-4gx4-v693 , EUVD-2021-0968

cvss
5.3
version 3.1, CNA
cisa kev
Not listed
not in CISA's catalog
epss
2.8%
EPSS 2.8% chance of exploitation in 30 days, percentile 86%
public exploits
0
none known

Summary

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.

Patch / fix

  • npm ws 5.2.3, 6.2.2, 7.4.6
  • ws_project ws 6.2.2, 7.4.6
  • node-ws Debian 14, Debian 13, Debian 12 7.4.2+~cs18.0.8-2

debian advisories DEBIAN-CVE-2021-32640

Vendor advisories

What the vendors themselves say about their products: affected, fixed or not affected, and what to do.

red hat product security vex CVE-2021-32640 updated cvss 5.3

nodejs-ws: Specially crafted value of the `Sec-Websocket-Protocol` header can be used to significantly slow down a ws server

  • Red Hat OpenShift Service Mesh 2.0 servicemesh-grafana, servicemesh-prometheus, servicemesh-grafana-prometheus Red Hat Advanced Cluster Management for Kubernetes 2 mcm-topology, mcm-topology-api, rhacm2/grc-ui-rhel8, rhacm2/console-rhel8, rhacm2/search-ui-rhel8, rhacm2/console-ui-rhel8, +6 more Red Hat Ansible Automation Platform 1.2 ws Red Hat OpenShift Container Platform 4 openshift4/ose-console, openshift4/ose-grafana, openshift4/ose-thanos-rhel9, openshift4/ose-prometheus-rhel9 Red Hat Openshift Container Storage 4 ocs4/mcg-core-rhel8
    affected: workaround, no fix available “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 and/or the maxHeaderSize options.”

Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf

Exploit prediction

2.82% chance of exploitation in the next 30 days, higher than 86% of all scored CVEs (FIRST EPSS, 2026-11-08).

Exploits and checks

  • github.com https://github.com/websockets/ws/security/advisories/GHSA-6fc8-4gx4-v693 referenced PoC, tagged "exploit" by a source, unverified

CVSS scores

assigned by version score vector
CNA 3.1 5.3 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
NVD 3.1 5.3 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
NVD 2.0 5.0 AV:N/AC:L/Au:N/C:N/I:N/A:P
GitHub 3.1 5.3 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

Affected packages

ecosystem package affected fixed in
npm ws
>=7.0.0, <7.4.6
>=6.0.0, <6.2.2
>=5.0.0, <5.2.3
7.4.6
6.2.2
5.2.3

Affected products

  • websockets ws

Classification

Weakness
  • CWE-400 Uncontrolled Resource Consumption
  • CWE-345 Insufficient Verification of Data Authenticity

References

Sources

Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.