CVE-2026-6402: webpack-dev-server Cross-Origin Source Code Exposure on Non-HTTPS Origins

webpack-dev-server Updated 18 May 2026

Summary

18/05/2026
Yes i
Moderate
5.3

CVE-2026-6402: webpack-dev-server vulnerable to cross-origin source code exposure on non-HTTPS origins. Affects webpack-dev-server versions < 5.2.4. Fixed in 5.2.4. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

webpack-dev-server is a popular development server for serving JavaScript applications, particularly those built with Webpack. It provides features such as live reloading and hot module replacement, making it easier for developers to build and test their applications in real-time. However, when running on non-HTTPS origins, it is vulnerable to cross-origin attacks that can expose sensitive source code.

Vulnerability Detail

The vulnerability arises when webpack-dev-server operates over a non-HTTPS connection, allowing malicious websites to make cross-origin requests that can load the server's JavaScript bundles. This can lead to the exfiltration of module source code by intercepting the webpack runtime's module registration. The initial fix in version 5.2.1 relied on specific request headers that are not sent over plain HTTP, making it ineffective in this context. This issue does not affect Chrome 142+ due to local network access restrictions.

How To Fix

Latest published version: 6.1.0 as of 22 Oct 2026

npm install webpack-dev-server@6.1.0

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

5.2.4

This is the first release that contains the fix.

npm install webpack-dev-server@5.2.4

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, you can run the dev server with HTTPS enabled by using the following command: webpack-dev-server --https. Alternatively, you can set 'server.type: https' in your configuration file.

Conclusion

In summary, the CVE-2026-6402 vulnerability in webpack-dev-server poses a significant risk when running on non-HTTPS origins. It is crucial to update to version 5.2.4 or later to mitigate this risk. Additionally, using HTTPS as a workaround can help protect your application until the update is applied.

See every vulnerability recorded for webpack-dev-server →

Share this vulnerability

FAQ

The vulnerability allows attackers to load and potentially exfiltrate the source code of your application if the dev server is running over HTTP.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. You can check your application without any signup using the Vulert playground.

The CVSS score of this vulnerability is 5.3, indicating a moderate level of risk.

Yes, you can run the dev server with HTTPS enabled as a temporary workaround until you can update to the patched version.

Failure to address this vulnerability could lead to unauthorized access to your application's source code, potentially exposing sensitive information and increasing the risk of further attacks.

Related vulnerabilities

Recent vulnerabilities recorded for webpack-dev-server.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Latest published version: 6.1.0 as of 22 Oct 2026

npm install webpack-dev-server@6.1.0

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

5.2.4

This is the first release that contains the fix.

npm install webpack-dev-server@5.2.4

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback