Visit the Wiz Whimzical Shop at AWS re:Invent
Vulnerability DatabaseCVE-2026-140102

CVE-2026-140102: 
JavaScript vulnerability analysis and mitigation

Overview

CVE-2026-140102 is a Denial of Service vulnerability in http-proxy-middleware, a widely used Node.js HTTP proxy middleware package. When ws: true is enabled, an HTTP Upgrade request whose path does not match the configured pathFilter leaves the raw socket without an error listener attached. A remote unauthenticated attacker can exploit this by sending such a crafted Upgrade request and then resetting the TCP connection, triggering an unhandled ECONNRESET error that terminates the entire gateway Node.js process — even when on.error, server.on('error'), and server.on('clientError') callbacks are configured. Affected versions span from 0.8.0 up to (but not including) 2.0.12, 3.0.11, and 4.2.2. The vulnerability carries a CVSS v3.1 base score of 7.5 (High) (GitHub Advisory).

Technical details

The root cause is classified as CWE-248 (Uncaught Exception): when the middleware's handleUpgrade function processes an Upgrade request whose path does not match pathFilter, it returns early without attaching an error listener to the raw TCP socket. This means any subsequent socket-level error (such as an ECONNRESET from a TCP RST) is emitted as an unhandled Node.js 'error' event, which by default throws and crashes the process. The fix, implemented in PRs #1328, #1329, and #1330, introduces a guardUpgradeSocket() helper that attaches a temporary error listener to every upgrade socket — matched or unmatched — before path filtering occurs, and removes it only after httpxy installs its own listener upon a successful matched upgrade (GitHub Advisory, Fix PR #1330). Exploitation requires no authentication and no user interaction; the only preconditions are that the target server uses http-proxy-middleware with ws: true, forwards 'upgrade' events to proxy.upgrade, and is reachable over the network on its listening port.

Impact

Successful exploitation results in a complete crash of the Node.js gateway process, causing a full denial of service for all clients relying on that gateway. There is no confidentiality or integrity impact — the vulnerability is purely an availability issue. Because a single crafted request is sufficient to terminate the process, an attacker can repeatedly crash the service, preventing recovery without process supervision or automatic restart mechanisms in place (GitHub Advisory).

Exploitability

A public proof-of-concept (PoC) exploit is available in the GitHub Security Advisory, consisting of a short Node.js client script that opens a raw TCP connection, sends a crafted HTTP Upgrade request to a non-matching path, and calls socket.resetAndDestroy() after 100 ms to trigger the crash (GitHub Advisory). The exploit requires no authentication, no privileges, and no user interaction, making it trivially weaponizable. As of the time of disclosure, there is no evidence of in-the-wild exploitation, no known threat actor attribution, and the EPSS score is reported as 0.0. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog.

Exploitation steps

  1. Identify a target: Locate a Node.js application using http-proxy-middleware (versions >= 0.8.0, < 2.0.12 / 3.0.11 / 4.2.2) with ws: true enabled and server.on('upgrade', proxy.upgrade) configured. The server must be reachable over the network.
  2. Open a raw TCP connection: Using Node.js net.connect() or a raw socket tool, establish a TCP connection to the gateway's listening port (e.g., net.connect(5056, '127.0.0.1', ...)).
  3. Send a crafted HTTP Upgrade request to a non-matching path: Write an HTTP/1.1 Upgrade request targeting a path that does NOT match the server's pathFilter (e.g., GET / when pathFilter is /ws):
    GET / HTTP/1.1\r\nHost: 127.0.0.1\r\nConnection: Upgrade\r\nUpgrade: websocket\r\n\r\n
  4. Reset the TCP connection: After a short delay (e.g., 100 ms), send a TCP RST by calling socket.resetAndDestroy(). This causes the server-side socket — which has no error listener attached — to emit an unhandled ECONNRESET error.
  5. Gateway process crashes: The Node.js process throws the unhandled 'error' event and terminates, producing output similar to:
    Error: read ECONNRESET
      at TCP.onStreamRead (node:internal/stream_base_commons:221:20)
    Emitted 'error' event on Socket instance ...
    throw er; // Unhandled 'error' event
    The entire gateway is now unavailable until restarted (GitHub Advisory).

Indicators of compromise

  • Network: Unexpected HTTP Upgrade requests (with Connection: Upgrade and Upgrade: websocket headers) targeting paths that do not match the application's configured WebSocket route (e.g., GET / instead of GET /ws); TCP RST packets from external clients shortly after sending an Upgrade request.
  • Logs: Node.js process crash logs containing Error: read ECONNRESET and Emitted 'error' event on Socket instance; gateway process exit events logged by a process manager (e.g., PM2, systemd) indicating unexpected restarts.
  • Process: Sudden termination of the Node.js gateway process followed by automatic restart; repeated process restarts in a short time window suggesting a sustained DoS attack.
  • Application: Increased frequency of gateway downtime or service interruptions correlated with inbound WebSocket Upgrade requests to non-proxied paths (GitHub Advisory).

Mitigation and workarounds

Upgrade http-proxy-middleware to one of the patched versions: 2.0.12, 3.0.11, or 4.2.2, depending on the currently deployed major version branch. The fix hardens the handleUpgrade function by attaching a temporary error listener to every upgrade socket before path filtering, preventing unhandled ECONNRESET errors from crashing the process (Fix PR #1328, Fix PR #1329, Fix PR #1330). As a short-term workaround prior to patching, consider placing a network-level firewall or reverse proxy (e.g., nginx) in front of the gateway to filter or rate-limit unexpected Upgrade requests, and ensure a process supervisor (PM2, systemd) is configured to automatically restart the gateway on crash.

Community reactions

The vulnerability was reported by security researcher samuel871211 with AI-assisted code analysis (Claude Code) and was published as a GitHub Security Advisory on November 22, 2026. The maintainer (chimurai) merged fixes across all three active branches on November 15, 2026 — prior to the public advisory — indicating a coordinated disclosure process. The advisory notes that AI assistance was used for code analysis, PoC drafting, and report writing, with the researcher manually verifying all findings (GitHub Advisory). Coverage appeared on automated vulnerability tracking platforms shortly after NVD publication, with no significant broader media or community discussion identified at the time of this report.

Additional resources


Source: This report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-140097CRITICAL9.1
  • JavaScript logoJavaScript
  • vite
NoYesNov 30, 2026
CVE-2026-140010HIGH8.7
  • JavaScript logoJavaScript
  • html-minifier
NoYesNov 30, 2026
CVE-2026-140008HIGH8.7
  • JavaScript logoJavaScript
  • minimatch
NoYesNov 30, 2026
CVE-2026-140102HIGH7.5
  • JavaScript logoJavaScript
  • http-proxy-middleware
NoNoNov 30, 2026
CVE-2026-140103MEDIUM5.4
  • JavaScript logoJavaScript
  • http-proxy-middleware
NoYesNov 30, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management