CVE-2026-6402 — webpack-dev-server
MEDIUMCVE-2026-6402 is a medium-severity (CVSS 5.3) CWE-749 vulnerability in webpack-dev-server. A fix is available for webpack-dev-server — see the affected versions and patch details below.
webpack-dev-server vulnerable to cross-origin source code exposure on non-HTTPS origins
Exploitation Status
No confirmed exploitation observed yet
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2026-6402.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
CVE-2026-6402 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.
Where this sits among everything scored
Of 380,526 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
webpack-dev-servernpmDescription
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 Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | webpack-dev-server | all versions | 5.2.4npm install webpack-dev-server@5.2.4 |
Affected Products
webpack-dev-serverwebpack.jsDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for webpack-dev-server, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update webpack-dev-server to 5.2.4 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-6402 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
Frequently Asked Questions
Is CVE-2026-6402 in your dependencies?
Find it across npm, including transitive dependencies.