← Back to overview

CVE-2026-76844 describes a path traversal vulnerability in webpack-dev-middleware affecting the getFilenameFromUrl function. The flaw arises when publicPath is configured without a trailing slash: a crafted request like GET /assets../.env bypasses the UP_PATH_REGEXP traversal guard because the dot-dot sequence is embedded within a path segment rather than standing alone. The offset slice then passes ../.env to path.join, resolving one directory above outputPath. Exploitation requires the middleware to use the physical filesystem, which occurs when writeToDisk is true or a custom outputFileSystem is supplied. The default memfs-backed configuration is not exploitable. Traversal depth is limited to a single directory level due to URL parsing collapsing additional dot-dot segments. The default publicPath of 'auto' (resolving to '/') is also not affected. This is identified as an incomplete fix for CVE-2024-29180, with the vulnerable code present in all releases from 5.3.4, 6.1.2, and 7.1.0 onward.

Affected products

  • webpack-dev-middleware

Related CVE's

  • CVE-2024-29180
  • CVE-2026-76844

Categories

  • Supply Chain & Dependencies
  • Web Technologies