undici is vulnerable to Unbounded Memory Consumption in undici WebSocket permessage-deflate Decompression
undici
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| undici npm |
|
|
Original description
The undici WebSocket client is vulnerable to a denial-of-service attack via unbounded memory consumption during permessage-deflate decompression. When a WebSocket connection negotiates the permessage-deflate extension, the client decompresses incoming compressed frames without enforcing any limit on the decompressed data size. A malicious WebSocket server can send a small compressed frame (a "decompression bomb") that expands to an extremely large size in memory, causing the Node.js process to exhaust available memory and crash or become unresponsive.