Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. webpack-dev-server
  4. ›
  5. CVE-2026-6402

CVE-2026-6402: webpack-dev-server vulnerable to cross-origin source code exposure on non-HTTPS origins

May 18, 2026

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 →

Affected versions

All versions before 5.2.4

Fixed versions

  • 5.2.4

Solution

Upgrade to version 5.2.4 or above.

Impact 5.3 MEDIUM

CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N

Learn more about CVSS

Weakness

  • CWE-749: Exposed Dangerous Method or Function

Source file

npm/webpack-dev-server/CVE-2026-6402.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Fri, 22 May 2026 00:18:17 +0000.