# ws, websocket-driver and http-proxy-middleware fix flaws that let one client crash a server

Advisories published on Dec 1 to 3 cover three npm packages with about 468 million downloads a week between them. The worst websocket-driver flaw is rated critical; the fixed versions shipped between Oct 24 and Nov 28.

By [AI Security Times](https://aisecuritytimes.com/authors/ai-security-times) · Published 2026-12-02T10:30:00Z · Updated 2026-12-03T04:42:04Z
Canonical: https://aisecuritytimes.com/tech/nodejs-websocket-libraries-dos-fixes

## Key facts

- CVE: CVE-2026-140004, CVE-2026-140009, CVE-2026-140102, CVE-2026-140000, CVE-2026-140001, CVE-2026-140002, CVE-2026-140003, CVE-2026-140005, CVE-2026-140103, CVE-2026-140016
- Severity: CVSS 9.1, Critical
- Status: Patch available
- Product: ws, websocket-driver and http-proxy-middleware (npm packages)
- Affected: ws before 8.23.0, 7.5.14, 6.2.7 and 5.2.8; websocket-driver before 0.8.2; http-proxy-middleware 0.8.0 to before 2.0.12, 3.0.11 and 4.2.2
- Fixed in: ws 8.23.0, 7.5.14, 6.2.7 and 5.2.8; websocket-driver 0.8.2; http-proxy-middleware 2.0.12, 3.0.11 and 4.2.2

### What to do now

1. Update the three packages to the fixed versions or later. Run npm ls ws websocket-driver http-proxy-middleware to find copies that other packages pull in.
2. In websocket-driver 0.8.0 and later, leave the old draft protocols off unless you need them: they are now disabled by default.
3. The http-proxy-middleware crash needs ws: true. Check which of your proxies have WebSocket support turned on.

Three widely used npm packages for WebSocket connections have fixed flaws that let a single remote client crash a Node.js process or exhaust its memory. The advisories were published between Dec 1 and Dec 3, up to three weeks after the fixed versions were released.

| Package | Flaw | Fixed in | Weekly downloads |
|---|---|---|---|
| ws | CVE-2026-140009, high (7.5) | 8.23.0, 7.5.14, 6.2.7 and 5.2.8, released Nov 12 | about 400 million |
| websocket-driver | CVE-2026-140004, critical (9.1), and five rated high (7.5) | 0.8.2, released Nov 28 | about 39.5 million |
| http-proxy-middleware | CVE-2026-140102, high (7.5) | 2.0.12, 3.0.11 and 4.2.2, released Nov 15 | about 28.4 million |

The download counts are npm's figures for Nov 24 to Nov 30. The scores are CVSS 3.1 ratings from the advisories.

## ws: pongs that pile up

ws is a WebSocket client and server library for Node.js. The WebSocket protocol answers every Ping frame with a Pong, and ws sends those answers automatically. According to the advisory, "A malicious peer can flood the other peer with Ping frames while stopping reads, forcing it to buffer Pong frames that are automatically sent in response until memory is exhausted, leading to process termination due to OOM."

The fix covers all four release lines, from 5.x to 8.x, so you can update without changing major versions.

## websocket-driver: old protocol drafts

websocket-driver still supported draft75 and draft76, versions of the WebSocket protocol from before it was standardised. A parsing bug in those versions lets an unauthenticated client duplicate messages or crash the server by "sending a brief sequence of bytes". The advisory adds: "No special conditions are required and the input message that triggers this behaviour is very short, so an attacker can easily crash a remote server."

Version 0.8.0, released on Nov 16, fixes the parser and turns the draft versions off by default. Servers that still need them have to pass the option allowDrafts: true.

That is not the end of it. websocket-driver has five more advisories, all rated high. Two denial-of-service flaws, one triggered by a malformed Sec-WebSocket-Key1 header and one by a single pong frame, are also fixed in 0.8.0. Two memory-exhaustion flaws, CVE-2026-140001 and CVE-2026-140002, need 0.8.1 (Nov 26). The last, CVE-2026-140000, was published on Dec 3 and needs 0.8.2 (Nov 28). "With the default configuration options, an unauthenticated remote client is able to force the server to retain large `Buffer` objects in memory far longer than necessary," that advisory says. Version 0.8.2 or later fixes all six. The Ruby gem of the same name had the same flaw, CVE-2026-140016, fixed in version 0.9.0, and a separate memory-exhaustion flaw fixed in 0.9.1.

## http-proxy-middleware: a crash on reset

http-proxy-middleware is a proxy component for Node.js web servers. The flaw only matters when WebSocket proxying is on (ws: true). In that case, an Upgrade request to a path the proxy does not handle "can leave the raw socket without an error listener", according to the CVE record. If the client then resets the TCP connection, the unhandled error "terminates the gateway process". A second, medium-rated advisory, CVE-2026-140103, covers request smuggling in some configurations. It was fixed earlier, in 2.0.11, 3.0.10 and 4.2.1 on Oct 24, so the versions above cover it too.

## What to do

Update the three packages, including copies that arrive as dependencies of other packages. For websocket-driver, that means 0.8.2 or later. Most of these are availability flaws: none of the advisories describes data theft or code execution, but a single client can take a service down.

Related: [node-tar 8 fixes 20 archive flaws, including symlink escapes, but needs Node.js 22](/tech/node-tar-18-advisories-symlink-escapes) · [cross-spawn fixes critical command injection when Node.js apps run batch files on Windows](/tech/cross-spawn-windows-batch-command-injection)

*Correction, Dec 3: An earlier version of this article said websocket-driver 0.8.0 fixes the flaws. It fixes the critical one, but two memory-exhaustion flaws published on Dec 1 need 0.8.1, and a third published on Dec 3 needs 0.8.2.*

## Sources

1. [GHSA-37g9-w4hg-h9qr: ws memory exhaustion via unbounded automatic pong responses](https://github.com/advisories/GHSA-37g9-w4hg-h9qr) (Advisory)
2. [GHSA-v36f-rjg3-3v46: websocket-driver message corruption and denial of service](https://github.com/advisories/GHSA-v36f-rjg3-3v46) (Advisory)
3. [GHSA-7487-9gcw-9w8w: websocket-driver memory exhaustion via zero-length fragmented frames](https://github.com/advisories/GHSA-7487-9gcw-9w8w) (Advisory)
4. [GHSA-j7r2-xppq-m353: websocket-driver memory exhaustion via small fragment frames](https://github.com/advisories/GHSA-j7r2-xppq-m353) (Advisory)
5. [GHSA-hvp5-3mrg-q5hg: http-proxy-middleware gateway crash via an Upgrade request](https://github.com/advisories/GHSA-hvp5-3mrg-q5hg) (Advisory)
6. [GHSA-pf93-24xc-xgxc: websocket-driver (Ruby) message corruption and denial of service](https://github.com/advisories/GHSA-pf93-24xc-xgxc) (Advisory)
7. [npm download counts for ws](https://api.npmjs.org/downloads/point/last-week/ws) (npm)
8. [npm download counts for websocket-driver](https://api.npmjs.org/downloads/point/last-week/websocket-driver) (npm)
9. [npm download counts for http-proxy-middleware](https://api.npmjs.org/downloads/point/last-week/http-proxy-middleware) (npm)

Topics: [Vulnerabilities](https://aisecuritytimes.com/topics/vulnerabilities), [Web security](https://aisecuritytimes.com/topics/web-security), [Patches](https://aisecuritytimes.com/topics/patches)
