Advisory

GHSA-79cf-xcqc-c78w

Also known as: CVE-2026-6402

Summary

webpack-dev-server vulnerable to cross-origin source code exposure on non-HTTPS origins

Details

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. 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.

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

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2026-05-18 13:31 UTC
Modified
2026-09-10 03:50 UTC

Affected packages and fixes

webpack-dev-server

npm · All systems

Affected

  • introduced 0, fixed 5.2.4 (semver)

Fixed versions

5.2.4

Fix

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences