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

> An attacker can read application source code if webpack-dev-server runs over HTTP, exposing sensitive data to malicious websites.

- **Severity:** Medium 5.3 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 12 May 2026
- **Updated:** 12 May 2026
- **Also known as:** CLEANSTART-2026-IF30069, CLSA-2026-1779238046, CLSA-2026-1784683094, CLSA-2026-1784769523, CLSA-2026-1784769600, CLSA-2026-1784856196, CLSA-2026-1784856456, CLSA-2026-1784943228, CLSA-2026-1784943286, CLSA-2026-1787828309, GHSA-79cf-xcqc-c78w, MINI-35h3-2mjj-5r6q, MINI-6529-9mrx-f639, MINI-jwjh-7jm8-gp7r, MINI-mjwc-76wp-pr7w, MINI-wj2x-8r9g-8823, MINI-wrmv-cqmq-p5g6, ROOT-APP-NPM-CVE-2026-6402

## What is CVE-2026-6402?

CVE-2026-6402 is a medium-severity vulnerability in webpack-dev-server, published on 12 May 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

webpack-dev-server versions up to and including 5.2.3 are vulnerable to cross-origin source code exposure when serving over a non-potentially trustworthy origin such as plain HTTP. The previous fix relied on the Sec-Fetch-Mode and Sec-Fetch-Site request headers, which browsers omit for non-trustworthy origins, allowing a malicious site to load the bundled source as a script and read it across origins. Impact: an attacker controlling a website visited by a developer running webpack-dev-server can recover the application source code when the dev server runs over HTTP at a guessable host and port. Chromium based browsers from Chrome 142 onward are not affected due to local network access restrictions. Upgrade to webpack-dev-server 5.2.4 or later, which sets Cross-Origin-Resource-Policy: same-origin on responses.

Weakness: CWE-749 (Exposed Dangerous Method or Function)

## Which versions are affected by CVE-2026-6402?

2 open source packages ship an affected version, including webpack-dev-server. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `webpack-dev-server` | npm | All versions | 5.2.4 |
| `webpack-dev-server` | npm | All versions | 5.2.4 |

Products: Webpack.js Webpack-Dev-Server.

## How do I fix CVE-2026-6402?

Upgrade webpack-dev-server to 5.2.4 or later.

## Is CVE-2026-6402 being exploited?

There is no known exploitation of CVE-2026-6402 in the wild and no public exploit code.

## Other vulnerabilities in webpack-dev-server

- [CVE-2026-112085](https://insights.sbomify.com/CVE-2026-112085/): webpack-dev-server vulnerable to cross-origin WebSocket access via proxied upgrades (high 8.2)
- [CVE-2018-14732](https://insights.sbomify.com/CVE-2018-14732/): Missing Origin Validation in webpack-dev-server (high 7.5)
- [CVE-2025-30360](https://insights.sbomify.com/CVE-2025-30360/): webpack-dev-server users' source code may be stolen when they access a malicious web site with non-Chromium based browser (medium 6.5)
- [CVE-2026-114348](https://insights.sbomify.com/CVE-2026-114348/): webpack-dev-server vulnerable to information disclosure via Host validation bypass in the open-editor endpoint (medium 5.3)
- [CVE-2026-14631](https://insights.sbomify.com/CVE-2026-14631/): webpack-dev-server vulnerable to denial of service via a malformed Host or Origin header (medium 5.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-6402 and fix it if it is affected.

What it is: CVE-2026-6402 is a medium-severity vulnerability in webpack-dev-server, published on 12 May 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2026-6402 in the wild and no public exploit code.

Affected packages and fixed versions:
- webpack-dev-server (npm): affected all versions; fixed in 5.2.4
- webpack-dev-server (npm): affected all versions; fixed in 5.2.4

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-6402/ (Markdown: https://insights.sbomify.com/CVE-2026-6402/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-6402
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-6402
- OSV: https://osv.dev/vulnerability/CVE-2026-6402

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-6402/
Summaries are generated and may contain mistakes; the official description above is the record.
