CVE-2026-6402: webpack-dev-server vulnerable to cross-origin source code exposure on non-HTTPS origins
When webpack-dev-server is running on a non-HTTPS origin (the default), cross-origin requests from malicious websites can load the dev server’s JavaScript bundles via <script> tags. The fix introduced in v5.2.1 (CVE-2025-30359) relied on Sec-Fetch-Mode and Sec-Fetch-Site request headers to block these requests, but browsers only send these headers for potentially trustworthy origins. Over plain HTTP, the headers are absent and the check is bypassed.
An attacker who knows the dev server’s host, port, and output path can exfiltrate all module source code by intercepting the webpack runtime’s module registration.
This does not affect Chrome 142+ (and other Chromium-based browsers) due to local network access restrictions.
References
- cna.openjsf.org/security-advisories.html
- github.com/advisories/GHSA-79cf-xcqc-c78w
- github.com/webpack/webpack-dev-server/security/advisories/GHSA-4v9v-hfq4-rm2v
- github.com/webpack/webpack-dev-server/security/advisories/GHSA-79cf-xcqc-c78w
- github.com/webpack/webpack-dev-server/security/advisories/GHSA-9jgg-88mc-972h
- nvd.nist.gov/vuln/detail/CVE-2026-6402
Code Behaviors & Features
Detect and mitigate CVE-2026-6402 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →