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.
- 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
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
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 | Affected | Fixed in |
|---|---|---|
webpack-dev-server npm | All versions | 5.2.1 |
webpack-dev-server npm | All versions | 5.2.1 |
Products include 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 webpack-dev-server vulnerable to cross-origin WebSocket access via proxied upgrades
- CVE-2018-14732 Missing Origin Validation in webpack-dev-server
- CVE-2025-30360 webpack-dev-server users' source code may be stolen when they access a malicious web site with non-Chromium based browser
- CVE-2026-114348 webpack-dev-server vulnerable to information disclosure via Host validation bypass in the open-editor endpoint
- CVE-2026-14631 webpack-dev-server vulnerable to denial of service via a malformed Host or Origin header
Sources
Also known as CLEANSTART-2026-VG68470, CLSA-2026-1774398064, CLSA-2026-1784769495, CLSA-2026-1784769529, GHSA-4v9v-hfq4-rm2v, MINI-2fx7-q59f-h942 and 2 more.