---
id: "CVE-2026-12151"
kind: "vulnerability"
aliases: ["CVE-2026-12151", "GHSA-vxpw-j846-p89q"]
title: "undici WebSocket client vulnerable to denial of service via fragment count bypass"
severity: "high"
cvss: 7.5
epss: 0.00789
exploited: false
status: "open"
category: "package"
products: [{"name": "undici", "fixed": ["6.27.0"], "affected": "< 6.27.0", "ecosystem": "npm"}, {"name": "undici", "fixed": ["7.28.0"], "affected": ">= 7.0.0, < 7.28.0", "ecosystem": "npm"}, {"name": "undici", "fixed": ["8.5.0"], "affected": ">= 8.0.0, < 8.5.0", "ecosystem": "npm"}, {"name": "nodejs undici", "fixed": ["6.27.0"], "affected": ">= 6.17.0, < 6.27.0", "ecosystem": "vendor"}, {"name": "nodejs undici", "fixed": ["7.28.0"], "affected": ">= 7.0.0, < 7.28.0", "ecosystem": "vendor"}, {"name": "nodejs undici", "fixed": ["8.5.0"], "affected": ">= 8.0.0, < 8.5.0", "ecosystem": "vendor"}]
ecosystems: ["npm", "vendor"]
tags: ["cwe-400", "cwe-770", "node.js", "npm", "package", "undici", "websocket"]
not_affected_if: ["no-websocket-client-use", "trusted-endpoints-only"]
published_at: "2026-06-17T17:16:42+00:00"
first_seen_at: "2026-11-04T03:41:23+00:00"
updated_at: "2026-11-04T03:46:40+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-vxpw-j846-p89q", "first_seen_at": "2026-11-04T03:41:23+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-12151", "first_seen_at": "2026-11-04T03:46:40+00:00"}]
---

# undici WebSocket client vulnerable to denial of service via fragment count bypass

The undici WebSocket client caps the total byte size of a message but not the number of fragments, so a malicious server can stream many tiny continuation frames. The client's memory grows without bound and the process can be exhausted into a denial of service.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- npm:undici affected < 6.27.0 fixed 6.27.0
- npm:undici affected >= 7.0.0, < 7.28.0 fixed 7.28.0
- npm:undici affected >= 8.0.0, < 8.5.0 fixed 8.5.0
- vendor:nodejs undici affected >= 6.17.0, < 6.27.0 fixed 6.27.0
- vendor:nodejs undici affected >= 7.0.0, < 7.28.0 fixed 7.28.0
- vendor:nodejs undici affected >= 8.0.0, < 8.5.0 fixed 8.5.0

## How to check

- Run `npm ls undici` in the project and check whether any resolved version falls in the affected ranges below.
- Check whether the app uses `new WebSocket(...)` or `WebSocketStream` from undici to connect to endpoints it does not fully control.

## Fix

- Upgrade undici to `6.27.0` on the 6.x line.
- Upgrade undici to `7.28.0` on the 7.x line.
- Upgrade undici to `8.5.0` on the 8.x line.

## Timeline

- 2026-11-04T03:41:23+00:00 ghsa https://github.com/advisories/GHSA-vxpw-j846-p89q
- 2026-11-04T03:46:40+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-12151

## Documents

- [advisory] NVD CVE-2026-121513 https://nvd.nist.gov/vuln/detail/CVE-2026-121513
- [advisory] NVD record CVE-2026-121511 (CNA: GitLab, affected <0.15.2) https://services.nvd.nist.gov/rest/json/cves/2.0?cveId=CVE-2026-121511
- [advisory] Maintainer's advisory: api.github.com https://api.github.com/repos/nodejs/undici/security-advisories/GHSA-vxpw-j846-p89q
- [advisory] Maintainer's advisory: github.com https://github.com/nodejs/undici/security/advisories/GHSA-vxpw-j846-p89q
- [advisory] Vendor advisory: cna.openjsf.org https://cna.openjsf.org/security-advisories.html
- [fix] Release: github.com https://github.com/nodejs/undici/releases/tag/v6.27.0
- [fix] Release: github.com https://github.com/nodejs/undici/releases/tag/v7.28.0
- [fix] Release: github.com https://github.com/nodejs/undici/releases/tag/v8.5.0
- [fix] Patch: github.com https://github.com/nodejs/undici/commit/32dbf0b3dd93daf6d87badf506d52e89f2e20e78

## From the sources

## Impact

The undici WebSocket client enforces `maxPayloadSize` on the cumulative byte count of fragments in a message but does not enforce a limit on the number of fragments. A malicious WebSocket server can stream many small or empty continuation frames that each pass per-frame and cumulative-size validation, collectively causing unbounded memory growth in the client process. The result is memory exhaustion and a denial of service.

Affected applications are those using the undici WebSocket client (`new WebSocket(...)`) or the `WebSocketStream` API that can be induced to connect to an attacker-controlled or compromised WebSocket endpoint.

All releases starting at undici 6.17.0 are affected.

## Patches

Upgrade to undici v6.27.0, v7.28.0 or v8.5.0.

## Workarounds

No workaround is available. The fix must be applied through an upgrade.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
