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

Medium 5.3 Published Updated

A specially crafted Sec-Websocket-Protocol header can cause significant slowdowns in ws servers, leading to denial of service.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2021-32640?

CVE-2021-32640 is a medium-severity denial of service vulnerability in Netapp E-Series Performance Analyzer, published on 25 May 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official 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.

Weakness: CWE-400

Which versions are affected by CVE-2021-32640?

6 open source packages ship an affected version, including ws. It affects 2 products.

PackageAffectedFixed in
ws npmFrom 5.0.05.2.3
ws npmFrom 5.0.05.2.3
ws npmFrom 6.0.06.2.2
ws npmFrom 6.0.06.2.2
ws npmFrom 7.0.07.4.6
ws npmFrom 7.0.07.4.6

Products include Netapp E-Series Performance Analyzer, Ws Project Ws.

How do I fix CVE-2021-32640?

Upgrade ws to a fixed version for your release line: 5.2.3, 6.2.2 or 7.4.6.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is CVE-2021-32640 being exploited?

There is no known exploitation of CVE-2021-32640 in the wild and no public exploit code.

All Netapp E-Series Performance Analyzer vulnerabilities

Sources

Also known as AZL-44670, CLSA-2026-1785380875, DEBIAN-CVE-2021-32640, GHSA-6fc8-4gx4-v693, ROOT-APP-NPM-CVE-2021-32640, UBUNTU-CVE-2021-32640.

Is CVE-2021-32640 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free