{"schema":"threatline.record/2","record":{"id":"CVE-2024-38355","aliases":["GHSA-25hc-qcg6-38wj"],"summary":"socket.io has an unhandled 'error' event","details":"### 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","categories":["Libraries & packages"],"product":"socket.io","vendor":"socketio","ecosystem":"npm","affected_ranges":[{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-25hc-qcg6-38wj","source_modified_at":"2026-09-24T14:45:27Z","fetched_at":"2026-10-23T18:42:43.628194Z","package":{"ecosystem":"npm","name":"socket.io"},"range":">= 3.0.0, < 4.6.2"},{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-25hc-qcg6-38wj","source_modified_at":"2026-09-24T14:45:27Z","fetched_at":"2026-10-23T18:42:43.628194Z","package":{"ecosystem":"npm","name":"socket.io"},"range":"< 2.5.1"},{"source":"CVE List","source_url":"https://www.cve.org/CVERecord?id=CVE-2024-38355","source_modified_at":"2024-09-03T20:35:40.515Z","fetched_at":"2026-10-23T18:45:31.882637Z","product":"socket.io","vendor":"socketio","versions":[{"version":"< 2.5.1","status":"affected"},{"version":">= 3.0.0,< 4.6.2","status":"affected"}],"defaultStatus":null},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-25hc-qcg6-38wj","source_modified_at":"2026-09-24T15:00:04.702589955Z","fetched_at":"2026-10-23T18:45:31.882637Z","package":{"name":"socket.io","ecosystem":"npm","purl":"pkg:npm/socket.io"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"2.5.1"}]}],"versions":[]},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-25hc-qcg6-38wj","source_modified_at":"2026-09-24T15:00:04.702589955Z","fetched_at":"2026-10-23T18:45:31.882637Z","package":{"name":"socket.io","ecosystem":"npm","purl":"pkg:npm/socket.io"},"ranges":[{"type":"SEMVER","events":[{"introduced":"3.0.0"},{"fixed":"4.6.2"}]}],"versions":[]}],"fixed_versions":[{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-25hc-qcg6-38wj","source_modified_at":"2026-09-24T14:45:27Z","fetched_at":"2026-10-23T18:42:43.628194Z","package":{"ecosystem":"npm","name":"socket.io"},"version":"4.6.2"},{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-25hc-qcg6-38wj","source_modified_at":"2026-09-24T14:45:27Z","fetched_at":"2026-10-23T18:42:43.628194Z","package":{"ecosystem":"npm","name":"socket.io"},"version":"2.5.1"},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-25hc-qcg6-38wj","source_modified_at":"2026-09-24T15:00:04.702589955Z","fetched_at":"2026-10-23T18:45:31.882637Z","package":{"name":"socket.io","ecosystem":"npm","purl":"pkg:npm/socket.io"},"version":"2.5.1"},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-25hc-qcg6-38wj","source_modified_at":"2026-09-24T15:00:04.702589955Z","fetched_at":"2026-10-23T18:45:31.882637Z","package":{"name":"socket.io","ecosystem":"npm","purl":"pkg:npm/socket.io"},"version":"4.6.2"}],"cvss":6.9,"severity":"Medium","kev":{"listed":false},"epss":{"probability":0.00807,"percentile":0.56422,"score_date":"2026-10-23"},"published_at":"2024-06-19T19:48:50.193Z","modified_at":"2026-09-24T15:00:04.702589955Z","provenance":[{"source":"GitHub Advisory Database","url":"https://github.com/advisories/GHSA-25hc-qcg6-38wj","fetched_at":"2026-10-23T18:42:43.628194Z","source_modified_at":"2026-09-24T14:45:27Z"},{"source":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2024-38355","fetched_at":"2026-10-23T18:45:31.882637Z","source_modified_at":"2024-09-03T20:35:40.515Z"},{"source":"OSV","url":"https://osv.dev/vulnerability/GHSA-25hc-qcg6-38wj","fetched_at":"2026-10-23T18:45:31.882637Z","source_modified_at":"2026-09-24T15:00:04.702589955Z"},{"source":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2024-38355","fetched_at":"2026-10-23T18:42:43.628194Z","source_modified_at":"2026-10-23"}],"sources":["GitHub Advisory Database","CVE List","OSV","EPSS"],"references":[{"source":"CVE List","url":"https://github.com/socketio/socket.io/security/advisories/GHSA-25hc-qcg6-38wj","tags":["x_refsource_CONFIRM","x_transferred"]},{"source":"CVE List","url":"https://github.com/socketio/socket.io/commit/15af22fc22bc6030fcead322c106f07640336115","tags":["x_refsource_MISC","x_transferred"]},{"source":"CVE List","url":"https://github.com/socketio/socket.io/commit/d30630ba10562bf987f4d2b42440fc41a828119c","tags":["x_refsource_MISC","x_transferred"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-38355","source":"GitHub Advisory Database"},{"url":"https://github.com/advisories/GHSA-25hc-qcg6-38wj","source":"GitHub Advisory Database"},{"source":"CVE List","url":"https://www.vicarius.io/vsociety/posts/unhandled-exception-in-socketio-cve-2024-38355"}],"locations":[],"motoko_assessment":{"status":"requires_architecture_review","automatic_remediation":false},"cve_state":"PUBLISHED","ssvc":{"exploitation":"none","automatable":"yes","technical_impact":"partial","assessed_at":"2024-09-03T15:54:14.198687Z"},"classification":{"method":"product-first software-layer rules","rules_version":"2.1","matched_on":"ecosystem","confidence":"heuristic","reviewed":false},"change_timestamp":"2026-09-24T15:00:04.702589955Z","content_hash":"ee9e101e0d030b1df052d8e57e0f3ec4de9e93eea9eea0718c7d236429ceb9d2"}}
