CVE-2026-6402: Webpack dev server Remote Code Execution Vulnerability

MODERATE
Advisory Identifier: GHSA-79cf-xcqc-c78w
CVSS 5.3
CWE-749
Published
Advisory Summary

CVE-2026-6402 is a MODERATE (CVSS 5.3) remote code execution vulnerability (CWE-749: Exposed Dangerous Method or Function) affecting Webpack dev server libraries in the npm ecosystem. The issue involves webpack-dev-server vulnerable to cross-origin source code exposure on non-https origins. Remediation is available by upgrading affected packages to version 5.2.4.

CVE-2026-6402 at a Glance

CVE Identifier CVE-2026-6402
GHSA Identifier GHSA-79cf-xcqc-c78w
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-749: Exposed Dangerous Method or Function
Affected Product Webpack dev server
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 5.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2026-6402

To remediate this vulnerability, upgrade all affected Webpack dev server dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

webpack-dev-server fixed: 5.2.4
npm install webpack-dev-server@5.2.4
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls webpack-dev-server

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-6402, inspect your project dependencies using npm:

npm ls webpack-dev-server

Analyze the terminal output to locate any version of Webpack dev server in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.2.4), your application is affected.

Note: The npm ls webpack-dev-server command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-749: Exposed Dangerous Method or Function, where the product provides an applications programming interface (api) or similar interface for interaction with external actors, but the interface includes a dangerous method or function that is not properly restricted. In Webpack dev server, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact 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](https://w3c.github.io/webappsec-secure-contexts/#is-origin-trustworthy). 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](https://developer.chrome.com/release-notes/142#local_network_access_restrictions). ### Patches Patched in webpack-dev-server >= 5.2.4 by setting `Cross-Origin-Resource-Policy: same-origin` on responses. ### Workarounds Run the dev server with HTTPS enabled (`--https` or `server.type: 'https'` in config). ### Resources - [GHSA-4v9v-hfq4-rm2v](https://github.com/webpack/webpack-dev-server/security/advisories/GHSA-4v9v-hfq4-rm2v) (CVE-2025-30359) - original vulnerability - [GHSA-9jgg-88mc-972h](https://github.com/webpack/webpack-dev-server/security/advisories/GHSA-9jgg-88mc-972h) (CVE-2025-30360) - prior bypass

CVE-2026-6402 Affected Webpack dev server Versions

1 component(s)
Fixed Versions:
5.2.4
Product / Package Ecosystem Affected Versions Fixed Version
webpack-dev-server
npm
< 5.2.4
5.2.4

References

Frequently Asked Questions

What is CVE-2026-6402?
CVE-2026-6402 is a security vulnerability in Webpack dev server involving webpack-dev-server vulnerable to cross-origin source code exposure on non-HTTPS origins under CWE-749: Exposed Dangerous Method or Function.
Which Webpack dev server versions are affected?
Affected versions include releases prior to 5.2.4 across affected packages: webpack-dev-server.
What version fixes CVE-2026-6402?
Upgrading to 5.2.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is webpack-dev-server affected?
Yes, webpack-dev-server is affected in releases prior to 5.2.4. Upgrade your dependency to 5.2.4 or later.
What is the CVSS score of CVE-2026-6402?
CVE-2026-6402 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2026-6402?
CVE-2026-6402 is classified under CWE-749: Exposed Dangerous Method or Function (The product provides an Applications Programming Interface (API) or similar interface for interaction with external actors, but the interface includes a dangerous method or function that is not properly restricted.).
How can I check npm dependencies for CVE-2026-6402?
Run the dependency tree command: 'npm ls webpack-dev-server'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-79cf-xcqc-c78w",
  "modified" : "2026-05-18T13:31:42Z",
  "published" : "2026-05-18T13:31:42Z",
  "aliases" : [ "CVE-2026-6402" ],
  "summary" : "webpack-dev-server vulnerable to cross-origin source code exposure on non-HTTPS origins",
  "details" : "### Impact\n\nWhen 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](https://w3c.github.io/webappsec-secure-contexts/#is-origin-trustworthy). Over plain HTTP, the headers are absent and the check is bypassed.\n\nAn 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.\n\nThis does not affect Chrome 142+ (and other Chromium-based browsers) due to [local network access restrictions](https://developer.chrome.com/release-notes/142#local_network_access_restrictions).\n\n### Patches\n\nPatched in webpack-dev-server >= 5.2.4 by setting `Cross-Origin-Resource-Policy: same-origin` on responses.\n\n### Workarounds\n\nRun the dev server with HTTPS enabled (`--https` or `server.type: 'https'` in config).\n\n### Resources\n\n- [GHSA-4v9v-hfq4-rm2v](https://github.com/webpack/webpack-dev-server/security/advisories/GHSA-4v9v-hfq4-rm2v) (CVE-2025-30359) - original vulnerability\n- [GHSA-9jgg-88mc-972h](https://github.com/webpack/webpack-dev-server/security/advisories/GHSA-9jgg-88mc-972h) (CVE-2025-30360) - prior bypass",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "webpack-dev-server"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.2.4"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 5.2.3"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/webpack/webpack-dev-server/security/advisories/GHSA-4v9v-hfq4-rm2v"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/webpack/webpack-dev-server/security/advisories/GHSA-79cf-xcqc-c78w"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/webpack/webpack-dev-server/security/advisories/GHSA-9jgg-88mc-972h"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-6402"
  }, {
    "type" : "WEB",
    "url" : "https://cna.openjsf.org/security-advisories.html"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/webpack/webpack-dev-server"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-749" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-18T13:31:42Z",
    "nvd_published_at" : "2026-05-12T09:16:55Z"
  }
}