Skip to content

← Actionable
Medium, CVSS 5.3amended

ReDoS in Sec-Websocket-Protocol header

CVE-2021-32640GHSA-6fc8-4gx4-v693

What to do

Vendor fix available. Upgrade each affected package to the fixed version on its release line (ws 7.4.6, 6.2.2, 5.2.3), redeploy, then verify what is actually installed.

This page has no inventory attached, so it cannot say whether you are affected. A vendor fix is not proof that your deployment is fixed.

Affected packages

  • npm ws

    Affected
    >= 7.0.0, < 7.4.6>= 6.0.0, < 6.2.2>= 5.0.0, < 5.2.3
    Fixed in
    7.4.6, 5.2.3, 6.2.2

Sources

Severity and exploitation
Exploitation
No confirmed exploitation recorded. Patch Next marks exploitation only from CISA KEV.
CVSS
5.3 · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
EPSS
  • CVE-2021-32640: 2.82% estimated exploitation activity in the next 30 days; percentile 86.59 (FIRST EPSS, 2026-11-03). This is a model estimate, not proof of exploitation or customer exposure.
Source description

As published by the source; long descriptions are shortened.

Impact A specially crafted value of the Sec-Websocket-Protocol header can be used to significantly slow down a ws server. Proof of concept Patches The vulnerability was fixed in ws@7.4.6 (https://github.com/websockets/ws/commit/00c425ec77993773d823f018f64a5c44e17023ff) and backported to ws@6.2.2 (https://github.com/websockets/ws/commit/78c676d2a1acefbc05292e9f7ea0a9457704bf1b) and ws@5.2.3 (https://github.com/websockets/ws/commit/76d47c1479002022a3e4357b3c9f0e23a68d4cd2). Workarounds 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. Credits The vulnerability was responsibly disclosed along with a fix in private by Robert McLaughlin from University of California, Santa Barbara.

Dates and revisions
Published by the source
Last modified by the source
Source last checked
  1. Revision 2 · amended ·

    Amended from ghsa record GHSA-6fc8-4gx4-v693

  2. Revision 1 · created ·

    Published from osv record GHSA-6fc8-4gx4-v693

Agent brief

Preview the exact text before you copy it. Commands are read-only suggestions; review them before running anything.

# Patch Next advisory brief: CVE-2021-32640

Advisory: ReDoS in Sec-Websocket-Protocol header
IDs: CVE-2021-32640, GHSA-6fc8-4gx4-v693
Record: https://patchnext.com/advisories/cve-2021-32640 (revision 2, source checked 26 Oct 2026, 12:21 UTC)
Inventory: none attached. This brief comes from a public page and does not say whether any deployment is affected.
Severity: Medium (CVSS 5.3)
Exploitation: no confirmed exploitation recorded. Patch Next confirms exploitation only from CISA KEV.
Vendor response: Vendor fix available; fixed versions by package: ws 7.4.6, 6.2.2, 5.2.3. A vendor fix does not mean a deployment is fixed.

## Affected components
- npm ws: affected >= 7.0.0, < 7.4.6; >= 6.0.0, < 6.2.2; >= 5.0.0, < 5.2.3; fixed in 7.4.6, 5.2.3, 6.2.2

## Suggested inspection (read-only)
- `npm ls ws --all`: lists every installed copy and version, including transitive ones. Run in the project root after `npm ci`.

## Supported action
Upgrade each affected component to a fixed version on its release line. For a transitive dependency, upgrade the parent package or add an override or constraint, then regenerate the lockfile. Redeploy every environment that ran an affected version.

## Required regression checks
- Run the test suite and a production build.
- Exercise the features that depend on ws.
- Repeat the inspection and confirm that only fixed versions remain installed.

## Rollback considerations
- Keep the previous lockfile and deployment artifact. Rolling back reinstates the vulnerable version, so apply any documented mitigation while you fix forward.

## Unresolved questions
- Which deployments run an affected version?
- Exploitation status can change. Check again before lowering the priority.
- Mark the work resolved only after the fixed version is verified in production.

## Sources
- Verified: https://osv.dev/vulnerability/GHSA-6fc8-4gx4-v693 (OSV record GHSA-6fc8-4gx4-v693 lists affected ranges: npm ws >=7.0.0 =6.0.0 =5.0.0 <5.2.3 (fixed))
- Verified: https://github.com/advisories/GHSA-6fc8-4gx4-v693 (GitHub-reviewed advisory GHSA-6fc8-4gx4-v693 lists affected ranges: npm ws >=7.0.0 =6.0.0 =5.0.0 <5.2.3)

Commands are suggestions: review each one before running it.

Loading voting…