Technical impact
The vulnerability is a path traversal flaw in webpack-dev-middleware’s getFilenameFromUrl. A publicPath without a trailing slash is matched by string prefix, and the ‘..’ guard is applied before that prefix is stripped. As a result, an attacker can construct a URL such as /assets../secret that resolves to a directory one level above the output directory. When the middleware serves from the physical filesystem through writeToDisk or a custom outputFileSystem, this allows reading of files outside the intended output area.
Affected Systems
The affected product is webpack’s webpack-dev-middleware. Vulnerable versions include 5.3.4, 6.1.2 through 6.1.3, 7.1.0 up to but not including 7.4.6, and 8.0.0 through 8.2.x (before 8.3.0). Applications using this middleware with writeToDisk enabled or a custom outputFileSystem are at risk.
Risk and Exploitability
The CVSS score of 8.3 indicates high severity, while the EPSS score of less than 1% indicates a low current likelihood of exploitation. The vulnerability is not listed in the CISA KEV catalog. The likely attack vector involves an unauthenticated attacker sending a crafted request to the middleware that bypasses the publicPath restriction and reads a file one directory above the output directory when writeToDisk or a custom outputFileSystem is used. This can lead to information disclosure of files outside the expected output area.
Github GHSA