CVE-2026-6402
CVE-2026-6402 is a vulnerability in webpack-dev-server versions up to and including 5.2.3 that allows for cross-origin source code exposure when serving over a non-potentially trustworthy origin such as plain HTTP. This issue arises because the previous fix relied on the Sec-Fetch-Mode and Sec-Fetch-Site request headers, which browsers omit for non-trustworthy origins. Consequently, a malicious site can load the bundled source as a script and read it across origins. The impact of this vulnerability is that an attacker controlling a website visited by a developer running webpack-dev-server can recover the application source code when the dev server runs over HTTP at a guessable host and port. Notably, Chromium-based browsers from Chrome 142 onward are not affected due to local network access restrictions. To mitigate this vulnerability, it is recommended to upgrade to webpack-dev-server 5.2.4 or later, which sets Cross-Origin-Resource-Policy: same-origin on responses.