{"id":"CVE-2024-38355","aliases":["CVE-2024-38355","GHSA-25hc-qcg6-38wj"],"related":[],"kind":"vulnerability","state":"published","title":"Unhandled 'error' event in socket.io","summary":"Socket.IO is an open source, real-time, bidirectional, event-based, communication framework. A specially crafted Socket.IO packet can trigger an uncaught exception on the Socket.IO server, thus killing the Node.js process. This issue is fixed by commit `15af22fc22` which has been included in `socket.io@4.6.2` (released in May 2023). The fix was backported in the 2.x branch as well with commit `d30630ba10`. Users are advised to upgrade. Users unable to upgrade may attach a listener for the \"error\" event to catch these errors.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Socket.IO is an open source, real-time, bidirectional, event-based, communication framework. A specially crafted Socket.IO packet can trigger an uncaught exception on the Socket.IO server, thus killing the Node.js process. This issue is fixed by commit `15af22fc22` which has been included in `socket.io@4.6.2` (released in May 2023). The fix was backported in the 2.x branch as well with commit `d30630ba10`. Users are advised to upgrade. Users unable to upgrade may attach a listener for the \"error\" event to catch these errors.","source":"cvelist"},{"lang":"en","text":"### Impact\n\nA specially crafted Socket.IO packet can trigger an uncaught exception on the Socket.IO server, thus killing the Node.js process.\n\n```\nnode:events:502\n    throw err; // Unhandled 'error' event\n    ^\n\nError [ERR_UNHANDLED_ERROR]: Unhandled error. (undefined)\n    at new NodeError (node:internal/errors:405:5)\n    at Socket.emit (node:events:500:17)\n    at /myapp/node_modules/socket.io/lib/socket.js:531:14\n    at process.processTicksAndRejections (node:internal/process/task_queues:77:11) {\n  code: 'ERR_UNHANDLED_ERROR',\n  context: undefined\n}\n```\n\n### Affected versions\n\n| Version range    | Needs minor update?                            |\n|------------------|------------------------------------------------|\n| `4.6.2...latest` | Nothing to do               |\n| `3.0.0...4.6.1`  | Please upgrade to `socket.io@4.6.2` (at least) |\n| `2.3.0...2.5.0`  | Please upgrade to `socket.io@2.5.1`            |\n\n### Patches\n\nThis issue is fixed by https://github.com/socketio/socket.io/commit/15af22fc22bc6030fcead322c106f07640336115, included in `socket.io@4.6.2` (released in May 2023).\n\nThe fix was backported in the 2.x branch today: https://github.com/socketio/socket.io/commit/d30630ba10562bf987f4d2b42440fc41a828119c\n\n### Workarounds\n\nAs a workaround for the affected versions of the `socket.io` package, you can attach a listener for the \"error\" event:\n\n```js\nio.on(\"connection\", (socket) => {\n  socket.on(\"error\", () => {\n    // ...\n  });\n});\n```\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n\n- Open a discussion [here](https://github.com/socketio/socket.io/discussions)\n\nThanks a lot to [Paul Taylor](https://github.com/Y0ursTruly) for the responsible disclosure.\n\n### References\n\n- https://github.com/socketio/socket.io/commit/15af22fc22bc6030fcead322c106f07640336115\n- https://github.com/socketio/socket.io/commit/d30630ba10562bf987f4d2b42440fc41a828119c","format":"markdown","source":"ghsa"},{"lang":"es","text":"Socket.IO es un framework de comunicación de código abierto, en tiempo real, bidireccional y basado en eventos. Un paquete Socket.IO especialmente manipulado puede desencadenar una excepción no detectada en el servidor Socket.IO, matando así el proceso Node.js. Este problema se solucionó mediante el commit `15af22fc22` que se incluyó en `socket.io@4.6.2` (publicado en mayo de 2023). La solución también se respaldó en la rama 2.x con el commit `d30630ba10`. Se recomienda a los usuarios que actualicen. Los usuarios que no puedan actualizar pueden adjuntar un detector del evento \"error\" para detectar estos errores.","source":"nvd"}],"published":"2024-06-19T15:04:41.000Z","modified":"2026-09-24T15:00:04.702Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L","score":7.3,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L","score":7.3,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L","score":7.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N","rating":"MEDIUM"}],"cwes":["CWE-20","CWE-754"],"affected":[{"ranges":[{"version":"< 2.5.1","status":"affected"},{"version":">= 3.0.0,< 4.6.2","status":"affected"}],"vendor":"socketio","product":"socket.io","source":"cvelist"},{"ranges":[{"type":"custom","introduced":"0","fixed":"2.5.1","status":"affected"},{"type":"custom","introduced":"3.0.0","fixed":"4.6.2","status":"affected"}],"vendor":"socket","product":"socket.io","cpe":"cpe:2.3:a:socket:socket.io:*:*:*:*:*:node.js:*:*","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.5.1"}],"ecosystem":"npm","package":"socket.io","purl":"pkg:npm/socket.io","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"3.0.0","status":"affected","fixed":"4.6.2"}],"ecosystem":"npm","package":"socket.io","purl":"pkg:npm/socket.io","source":"ghsa"}],"references":[{"url":"https://github.com/socketio/socket.io/security/advisories/GHSA-25hc-qcg6-38wj","tags":["web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/socketio/socket.io/commit/15af22fc22bc6030fcead322c106f07640336115","tags":["web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/socketio/socket.io/commit/d30630ba10562bf987f4d2b42440fc41a828119c","tags":["web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://www.vicarius.io/vsociety/posts/unhandled-exception-in-socketio-cve-2024-38355","tags":[],"sources":["cvelist","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-38355","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/socketio/socket.io","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2024-09-03T15:54:14.198Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-38355","url":"https://www.cve.org/CVERecord?id=CVE-2024-38355","licence":"CVE Terms of Use","modified":"2024-09-03T20:35:40.515Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-25hc-qcg6-38wj","url":"https://github.com/advisories/GHSA-25hc-qcg6-38wj","licence":"CC-BY-4.0","modified":"2026-09-24T15:00:04.702Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-38355","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-38355","licence":"Public domain","modified":"2026-06-17T07:39:58.987Z"}],"updatedAt":"2026-11-25T22:58:42.053Z","epss":{"score":0.00807,"percentile":0.57981,"date":"2026-12-01T12:00:22.000Z"}}