webpack-dev-server vulnerable to information disclosure via Host validation bypass in the open-editor endpoint
Summary
webpack-dev-server is a development server that provides live reloading for webpack projects. In versions from 5.1.0 before 5.2.7 and in version 6.0.0, the unauthenticated open-editor endpoint validates the Host header with a regular expression meant for browser Origin schemes, so a Host value begin...
Affected packages
| Ecosystem | Package | Affected | Fixed |
|---|---|---|---|
| webpack-dev-server | webpack-dev-server |
≥ 5.1.0, < 5.2.7 ≥ 6.0.0, < 6.1.0 |
5.2.7 6.1.0 |
Original description The description as published by the source.
webpack-dev-server is a development server that provides live reloading for webpack projects. In versions from 5.1.0 before 5.2.7 and in version 6.0.0, the unauthenticated open-editor endpoint validates the Host header with a regular expression meant for browser Origin schemes, so a Host value beginning with file: or with an extension scheme short-circuits the hostname and allowedHosts checks. A network peer that can reach the dev server can send a request with a malformed Host that passes validation and then causes the endpoint's URL construction to throw, and in the default non-production mode the server returns an HTTP 500 body containing the full exception stack trace, which discloses absolute filesystem paths, installed module locations, and internal source line numbers. The server keeps running, so there is no denial of service. The issue is fixed in webpack-dev-server 5.2.7 and 6.1.0, and users should upgrade to one of those versions or later.
Source: CVE.org (CVE Program・cvelistV5) NVD
References
- REDHAT Red Hat
- web github.com
- web cna.openjsf.org