# CVE-2024-37890: Denial of service when handling a request with many HTTP headers in ws

> Attackers can crash a ws server by sending requests with excessive HTTP headers, affecting Node.js applications using this library.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 17 Jun 2024
- **Updated:** 2 Aug 2024
- **Also known as:** AZL-42808, AZL-43600, AZL-45066, CLSA-2026-1773360970, CLSA-2026-1774225216, CLSA-2026-1785380886, CLSA-2026-1793096799, DEBIAN-CVE-2024-37890, ECHO-6481-47b9-c083, GHSA-3h5v-q93c-6h6q, MINI-9qw4-rwg7-v97w, MINI-v8qv-8cfh-rh9f, MINI-w2pf-pfcg-cfg7, RHBA-2024:9549, RHBA-2024:9550, RHBA-2025:4932, ROOT-APP-NPM-CVE-2024-37890, UBUNTU-CVE-2024-37890

## What is CVE-2024-37890?

CVE-2024-37890 is a high-severity denial of service vulnerability in websockets ws, published on 17 Jun 2024. 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 for Node.js. A request with a number of headers exceeding theserver.maxHeadersCount threshold could be used to crash a ws server. The vulnerability was fixed in ws@8.17.1 (e55e510) and backported to ws@7.5.10 (22c2876), ws@6.2.3 (eeb76d3), and ws@5.2.4 (4abd8f6). In vulnerable versions of ws, the issue can be mitigated in the following ways: 1. Reduce the maximum allowed length of the request headers using the --max-http-header-size=size and/or the maxHeaderSize options so that no more headers than the server.maxHeadersCount limit can be sent. 2. Set server.maxHeadersCount to 0 so that no limit is applied.

Weakness: CWE-476 (NULL Pointer Dereference)

## Which versions are affected by CVE-2024-37890?

8 open source packages ship an affected version, including ws.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `ws` | npm | From 2.1.0 | 5.2.4 |
| `ws` | npm | From 2.1.0 | 5.2.4 |
| `ws` | npm | From 6.0.0 | 6.2.3 |
| `ws` | npm | From 6.0.0 | 6.2.3 |
| `ws` | npm | From 7.0.0 | 7.5.10 |
| `ws` | npm | From 7.0.0 | 7.5.10 |
| `ws` | npm | From 8.0.0 | 8.17.1 |
| `ws` | npm | From 8.0.0 | 8.17.1 |
| `aspnetcore-runtime-8.0` | Red Hat:enterprise_linux:10.0 | All versions | 0:8.0.13-2.el10_0 |
| `aspnetcore-runtime-dbg-8.0` | Red Hat:enterprise_linux:10.0 | All versions | 0:8.0.13-2.el10_0 |
| `aspnetcore-targeting-pack-8.0` | Red Hat:enterprise_linux:10.0 | All versions | 0:8.0.13-2.el10_0 |
| `dotnet-apphost-pack-8.0` | Red Hat:enterprise_linux:10.0 | All versions | 0:8.0.13-2.el10_0 |
| `dotnet-apphost-pack-8.0-debuginfo` | Red Hat:enterprise_linux:10.0 | All versions | 0:8.0.13-2.el10_0 |
| `dotnet-hostfxr-8.0` | Red Hat:enterprise_linux:10.0 | All versions | 0:8.0.13-2.el10_0 |
| `dotnet-hostfxr-8.0-debuginfo` | Red Hat:enterprise_linux:10.0 | All versions | 0:8.0.13-2.el10_0 |
| `dotnet-runtime-8.0` | Red Hat:enterprise_linux:10.0 | All versions | 0:8.0.13-2.el10_0 |
| `dotnet-runtime-8.0-debuginfo` | Red Hat:enterprise_linux:10.0 | All versions | 0:8.0.13-2.el10_0 |
| `dotnet-runtime-dbg-8.0` | Red Hat:enterprise_linux:10.0 | All versions | 0:8.0.13-2.el10_0 |
| `dotnet-sdk-8.0` | Red Hat:enterprise_linux:10.0 | All versions | 0:8.0.113-2.el10_0 |
| `dotnet-sdk-8.0-debuginfo` | Red Hat:enterprise_linux:10.0 | All versions | 0:8.0.113-2.el10_0 |
| `dotnet-sdk-8.0-source-built-artifacts` | Red Hat:enterprise_linux:10.0 | All versions | 0:8.0.113-2.el10_0 |
| `dotnet-sdk-dbg-8.0` | Red Hat:enterprise_linux:10.0 | All versions | 0:8.0.113-2.el10_0 |
| `dotnet-targeting-pack-8.0` | Red Hat:enterprise_linux:10.0 | All versions | 0:8.0.13-2.el10_0 |
| `dotnet-templates-8.0` | Red Hat:enterprise_linux:10.0 | All versions | 0:8.0.113-2.el10_0 |
| `dotnet8.0` | Red Hat:enterprise_linux:10.0 | All versions | 0:8.0.113-2.el10_0 |
| `dotnet8.0-debugsource` | Red Hat:enterprise_linux:10.0 | All versions | 0:8.0.113-2.el10_0 |
| `aspnetcore-runtime-6.0` | Red Hat:enterprise_linux:9::appstream | All versions | 0:6.0.35-2.el9_5 |
| `aspnetcore-runtime-8.0` | Red Hat:enterprise_linux:9::appstream | All versions | 0:8.0.10-3.el9_5 |
| `aspnetcore-runtime-dbg-8.0` | Red Hat:enterprise_linux:9::appstream | All versions | 0:8.0.10-3.el9_5 |
| `aspnetcore-targeting-pack-6.0` | Red Hat:enterprise_linux:9::appstream | All versions | 0:6.0.35-2.el9_5 |
| `aspnetcore-targeting-pack-8.0` | Red Hat:enterprise_linux:9::appstream | All versions | 0:8.0.10-3.el9_5 |
| `dotnet-apphost-pack-6.0` | Red Hat:enterprise_linux:9::appstream | All versions | 0:6.0.35-2.el9_5 |
| `dotnet-apphost-pack-6.0-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:6.0.35-2.el9_5 |
| `dotnet-apphost-pack-8.0` | Red Hat:enterprise_linux:9::appstream | All versions | 0:8.0.10-3.el9_5 |
| `dotnet-apphost-pack-8.0-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:8.0.10-3.el9_5 |
| `dotnet-hostfxr-6.0` | Red Hat:enterprise_linux:9::appstream | All versions | 0:6.0.35-2.el9_5 |
| `dotnet-hostfxr-6.0-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:6.0.35-2.el9_5 |
| `dotnet-hostfxr-8.0` | Red Hat:enterprise_linux:9::appstream | All versions | 0:8.0.10-3.el9_5 |
| `dotnet-hostfxr-8.0-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:8.0.10-3.el9_5 |
| `dotnet-runtime-6.0` | Red Hat:enterprise_linux:9::appstream | All versions | 0:6.0.35-2.el9_5 |

## How do I fix CVE-2024-37890?

Upgrade ws to a fixed version for your release line: 5.2.4, 6.2.3, 7.5.10 or 8.17.1.

## Is CVE-2024-37890 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-37890 exists.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-37890 and fix it if it is affected.

What it is: CVE-2024-37890 is a high-severity denial of service vulnerability in websockets ws, published on 17 Jun 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-37890 exists.

Affected packages and fixed versions:
- ws (npm): affected from 2.1.0; fixed in 5.2.4
- ws (npm): affected from 2.1.0; fixed in 5.2.4
- ws (npm): affected from 6.0.0; fixed in 6.2.3
- ws (npm): affected from 6.0.0; fixed in 6.2.3
- ws (npm): affected from 7.0.0; fixed in 7.5.10
- ws (npm): affected from 7.0.0; fixed in 7.5.10
- ws (npm): affected from 8.0.0; fixed in 8.17.1
- ws (npm): affected from 8.0.0; fixed in 8.17.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-37890/ (Markdown: https://insights.sbomify.com/CVE-2024-37890/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-37890
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-37890
- OSV: https://osv.dev/vulnerability/CVE-2024-37890

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-37890/
Summaries are generated and may contain mistakes; the official description above is the record.
