MODERATE 5.3

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

Affected Maven artifacts (2)

ArtifactAffected versionsFixed 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

2affected artifacts
18affected versions
9dependent artifacts (est.)
16dependent versions

55% of the dependent artifacts (5) still pull an affected version in their latest release.

DepthDependent versions
Direct
15
2 hops
1

Most used dependents

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