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.
Problem types
CWE-749: Exposed Dangerous Method or Function
Product status
Any version before 5.2.4
5.2.4 (semver)
Credits
sapphi-red
Ulises Gascón
Sebastian Beltran
Alexander Akait
References
github.com/...server/security/advisories/GHSA-79cf-xcqc-c78w
cna.openjsf.org/security-advisories.html