Skip to main content
Vulnerability Database/CVE-2026-112085

CVE-2026-112085: webpack-dev-server CSRF Vulnerability

CVE-2026-112085 is a cross-site request forgery flaw in webpack-dev-server that bypasses Host validation on proxied WebSocket upgrades. This post explains its impact, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-112085 Overview

CVE-2026-112085 is an origin validation flaw [CWE-346] in webpack-dev-server, the development server that provides live reloading for webpack projects. Versions before 5.2.7 and version 6.0.0 forward non-HMR WebSocket upgrade requests to configured proxy targets without validating Host or Origin headers. The allowedHosts protection does not apply to these proxied upgrades. A malicious web page visited by a developer can open a cross-origin WebSocket through the dev server and read from and write to the proxied backend, even when the server is bound to loopback.

Critical Impact

An attacker-controlled web page can pivot through a developer's local dev server to interact with internal backend services over WebSockets, bypassing loopback and allowedHosts protections.

Affected Products

  • webpack-dev-server versions prior to 5.2.7
  • webpack-dev-server version 6.0.0
  • Developer environments using proxy entries configured to forward WebSockets

Discovery Timeline

  • 2026-10-22 - CVE-2026-112085 published to NVD
  • 2026-10-22 - Last updated in NVD database

Technical Details for CVE-2026-112085

Vulnerability Analysis

webpack-dev-server enforces Host and Origin header validation on the Hot Module Replacement (HMR) WebSocket endpoint through the allowedHosts option. This control stops cross-origin JavaScript running in a developer's browser from establishing a WebSocket to the local dev server.

The control did not extend to WebSocket upgrades handled by the proxy subsystem. When a developer configured a proxy entry with WebSocket forwarding enabled, the dev server accepted the upgrade request and forwarded it to the proxied backend without re-applying Host or Origin checks. An attacker-hosted page could therefore use the WebSocket API to reach any upstream service the proxy was configured to forward, including services bound to loopback or internal networks reachable from the developer workstation.

The flaw is network-reachable through user interaction, requires no authentication, and crosses a trust boundary from the browser into developer backend services. It enables both read and write access over the proxied WebSocket channel.

Root Cause

The root cause is missing authentication of the upgrade request's origin [CWE-346] in the WebSocket proxy path. The HMR socket handler validated Host and Origin against allowedHosts, but the proxy upgrade handler did not share that check, creating an inconsistent trust model between two code paths that terminate WebSocket upgrades on the same listener.

Attack Vector

Exploitation requires a developer to visit an attacker-controlled page while webpack-dev-server is running with WebSocket proxying enabled. The malicious page issues a cross-origin new WebSocket("ws://localhost:<port>/<proxied-path>") request. The dev server forwards the upgrade to the configured proxy target without origin validation, after which the attacker's script can exchange arbitrary WebSocket frames with the backend. See the GitHub Webpack Security Advisory GHSA-cfqc-fj3v-j925 for additional technical context.

Detection Methods for CVE-2026-112085

Indicators of Compromise

  • Unexpected WebSocket upgrade requests to webpack-dev-server ports (commonly 8080, 3000, 5173) from browsers with Origin headers pointing to unknown external domains.
  • Proxy access logs showing WebSocket traffic to backend paths that were not initiated by the developer's own application.
  • Backend service logs reporting WebSocket sessions sourced from the dev server during periods of normal web browsing.

Detection Strategies

  • Audit webpack.config.js and webpack-dev-server configurations for proxy entries where ws: true is set and verify the installed webpack-dev-server version against 5.2.7 or 6.1.0.
  • Inspect HTTP request logs on developer workstations for Upgrade: websocket requests to localhost with foreign Origin headers.
  • Correlate browser process network activity with dev server listener ports to identify cross-origin WebSocket attempts.

Monitoring Recommendations

  • Enable verbose logging on backend services behind proxied WebSocket endpoints and alert on unexpected session sources.
  • Monitor developer endpoints for installations of outdated webpack-dev-server packages through software inventory tooling.
  • Track outbound DNS and HTTP activity from developer workstations to flag browsing sessions that coincide with anomalous local WebSocket traffic.

How to Mitigate CVE-2026-112085

Immediate Actions Required

  • Upgrade webpack-dev-server to version 5.2.7 or 6.1.0 or later, where proxied WebSocket upgrades apply the same Host and Origin validation as the HMR WebSocket.
  • Inventory projects using webpack-dev-server and identify any proxy configuration entries that enable WebSocket forwarding.
  • Instruct developers to avoid browsing untrusted sites while the dev server is running until upgrades are complete.

Patch Information

The maintainers fixed the issue in webpack-dev-server5.2.7 and 6.1.0. In the patched versions, proxied WebSocket upgrades pass through the same Host and Origin validation applied to the HMR WebSocket endpoint, bringing the proxy path under allowedHosts enforcement. Review the GitHub Webpack Security Advisory GHSA-cfqc-fj3v-j925 and the OpenJS Foundation Security Advisories for release details.

Workarounds

  • Remove ws: true from proxy entries that do not require WebSocket forwarding.
  • Scope each proxy entry to specific paths rather than broad prefixes to limit which backend endpoints are reachable through the dev server.
  • Restrict allowedHosts to an explicit allowlist and bind the dev server to loopback only, while recognizing these controls alone do not fully mitigate the proxied upgrade path.

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.