CVE-2026-6402
webpack-dev-server vulnerable to cross-origin source code exposure on non-HTTPS origins
Description
Impact
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.
Patches
Patched in webpack-dev-server >= 5.2.4 by setting Cross-Origin-Resource-Policy: same-origin on responses.
Workarounds
Run the dev server with HTTPS enabled (--https or server.type: 'https' in config).
Resources
- GHSA-4v9v-hfq4-rm2v (CVE-2025-30359) - original vulnerability
- GHSA-9jgg-88mc-972h (CVE-2025-30360) - prior bypass
Affected Maven artifacts (2)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| org.mvnpm » webpack-dev-servervia npm webpack-dev-server | < 5.2.4 | 5.2.4 |
| org.webjars.npm » webpack-dev-servervia npm webpack-dev-server | < 5.2.4 | 5.2.4 |
Blast radius
55% of the dependent artifacts (5) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 15 |
| 2 hops | 1 |
Most used dependents
- org.mvnpm.at.rspack » dev-server2 usages
- org.webjars.npm » swagger-ui1 usages
- org.mvnpm » react-scripts1 usages
- org.webjars.npm » react-web0 usages
- org.webjars.npm » angular-cli0 usages
- org.webjars.npm » swagger-editor0 usages
- org.mvnpm » angular-cli0 usages
- org.mvnpm » preactjs0 usages
- org.webjars.npm » react-scripts0 usages
Computed from the dependency graph of build 20261203.1441 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
Other ecosystems
Also affects npm (1 package) . See all on OSV
References
| Advisory | NVD CVE-2026-6402 | nvd.nist.gov |
| Package | webpack/webpack-dev-server | github.com |
| Web | webpack/webpack-dev-server advisory GHSA-4v9v-hfq4-rm2v | github.com |
| Web | webpack/webpack-dev-server advisory GHSA-79cf-xcqc-c78w | github.com |
| Web | webpack/webpack-dev-server advisory GHSA-9jgg-88mc-972h | github.com |
| Web | security-advisories.html | cna.openjsf.org |
