---
id: "GHSA-m25w-q28w-j8fp"
page: "https://infrastack.ai/live/GHSA-m25w-q28w-j8fp"
kind: "vulnerability"
aliases: ["GHSA-m25w-q28w-j8fp"]
title: "Process crash via a large WebSocket message to a WsAdapter gateway"
severity: "high"
cvss: null
epss: null
exploited: false
status: "open"
category: "package"
products: [{"name": "@nestjs/platform-ws", "fixed": ["12.5.0"], "affected": ">= 12.0.0, < 12.5.0", "ecosystem": "npm"}, {"name": "@nestjs/platform-ws", "fixed": ["11.2.10"], "affected": "< 11.2.10", "ecosystem": "npm"}]
ecosystems: ["npm"]
tags: ["cwe-400", "cwe-770", "nestjs", "node.js", "package", "self-hosted", "websocket"]
not_affected_if: ["auth-required", "maxpayload-set", "socketio-adapter"]
published_at: "2026-11-12T19:03:48+00:00"
first_seen_at: "2026-11-12T19:14:24+00:00"
updated_at: "2026-11-12T19:15:49+00:00"
sources: [{"source": "ghsa-repo", "url": "https://github.com/nestjs/nest/security/advisories/GHSA-m25w-q28w-j8fp", "first_seen_at": "2026-11-12T19:14:24+00:00"}]
exploit_sources: []
---

# Process crash via a large WebSocket message to a WsAdapter gateway

Link for people: https://infrastack.ai/live/GHSA-m25w-q28w-j8fp (this .md is for agents)

The NestJS WebSocket adapter @nestjs/platform-ws accepted client messages up to 100 MiB and parsed each one whole before any handler ran. A single large message from a connected client can exhaust memory and terminate the Node.js process, causing a denial of service.

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

## Affected

- npm:@nestjs/platform-ws affected >= 12.0.0, < 12.5.0 fixed 12.5.0
- npm:@nestjs/platform-ws affected < 11.2.10 fixed 11.2.10

## How to check

- Check the installed version with `npm ls @nestjs/platform-ws`; versions below `11.2.10`, or from `12.0.0` up to but not including `12.5.0`, are affected.
- Search the code for `new WsAdapter(` and `@WebSocketGateway(` and see whether the gateway options set `maxPayload`; without it the 100 MiB default applies.

## Fix

- `@nestjs/platform-ws` `11.2.10` for the 11.x line
- `@nestjs/platform-ws` `12.5.0` for the 12.x line
- Until upgrading, set `maxPayload` in the options of each `@WebSocketGateway()` (the advisory's workaround).

## Timeline

- 2026-11-12T19:14:24+00:00 ghsa-repo https://github.com/nestjs/nest/security/advisories/GHSA-m25w-q28w-j8fp

## Documents

- [advisory] Maintainer's advisory: github.com https://github.com/nestjs/nest/security/advisories/GHSA-m25w-q28w-j8fp

## From the sources

| Field | Value |
| --- | --- |
| Ecosystem | npm |
| Package | `@nestjs/platform-ws` |
| Affected versions | `< 11.2.10` and `>= 12.0.0, < 12.5.0` |
| Patched versions | `11.2.10` and `12.5.0` |
| Severity | High |
| CVSS v3.1 | `AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H` (7.5) |
| CWE | CWE-770 (Allocation of Resources Without Limits or Throttling), CWE-400 (Uncontrolled Resource Consumption) |

### Summary

`WsAdapter` accepted client messages of up to 100 MiB, the `ws` library's default, and parsed each message whole before any handler or guard ran. A single large message from any client that could open a connection could exhaust the heap and terminate the process.

### Impact

Applications that use `@nestjs/platform-ws` (`app.useWebSocketAdapter(new WsAdapter(app))`) without a `maxPayload` in their gateway options are affected. No authentication is needed unless the connection is refused at the upgrade. The default Socket.IO adapter is not affected: engine.io limits messages to 1 MB by default.

### Patches

Fixed in **11.2.10** and **12.5.0**. `WsAdapter` now limits client messages to 1 MB by default and closes a connection that sends a larger one with code 1009. A gateway's own `maxPayload` still takes precedence, and the new `maxPayload` option of the adapter changes the default.

### Workarounds

Set `maxPayload` in the options of each `@WebSocketGateway()`.

### Credit

Reported by Anthropic's OSS Scanner.

---

_Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai_
