# CVE-2025-30359: webpack-dev-server users' source code may be stolen when they access a malicious web site

> Attackers can steal source code from developers using webpack-dev-server by accessing a malicious website, requiring knowledge of the port and script path.

- **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:** 3 Jun 2025
- **Updated:** 3 Jun 2025
- **Also known as:** CLEANSTART-2026-VG68470, CLSA-2026-1774398064, CLSA-2026-1784769495, CLSA-2026-1784769529, GHSA-4v9v-hfq4-rm2v, MINI-2fx7-q59f-h942, MINI-xh7m-vh48-mw2g, ROOT-APP-NPM-CVE-2025-30359

## What is CVE-2025-30359?

CVE-2025-30359 is a medium-severity vulnerability in webpack-dev-server, published on 3 Jun 2025. 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 allows users to use webpack with a development server that provides live reloading. Prior to version 5.2.1, webpack-dev-server users' source code may be stolen when they access a malicious web site. Because the request for classic script by a script tag is not subject to same origin policy, an attacker can inject a malicious script in their site and run the script. Note that the attacker has to know the port and the output entrypoint script path. Combined with prototype pollution, the attacker can get a reference to the webpack runtime variables. By using `Function::toString` against the values in `__webpack_modules__`, the attacker can get the source code. Version 5.2.1 contains a patch for the issue.

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

## Which versions are affected by CVE-2025-30359?

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.1 |
| `webpack-dev-server` | npm | All versions | 5.2.1 |

Products: Webpack.js Webpack-Dev-Server.

## How do I fix CVE-2025-30359?

Upgrade webpack-dev-server to 5.2.1 or later.

## Is CVE-2025-30359 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-30359 exists.

## 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-2025-30359 and fix it if it is affected.

What it is: CVE-2025-30359 is a medium-severity vulnerability in webpack-dev-server, published on 3 Jun 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-30359 exists.

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

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-2025-30359/ (Markdown: https://insights.sbomify.com/CVE-2025-30359/index.md)
```

## Sources

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

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