PT-2024-3876 · Webpack · Webpack-Dev-Middleware+1

Palirichtarik

·

Published

2024-03-21

·

Updated

2026-02-18

·

CVE-2024-29180

CVSS v2.0

7.8

High

VectorAV:N/AC:L/Au:N/C:C/I:N/A:N
Name of the Vulnerable Software and Affected Versions: webpack-dev-middleware versions prior to 7.1.0 webpack-dev-middleware versions prior to 6.1.2 webpack-dev-middleware versions prior to 5.3.4
Description: The webpack-dev-middleware does not sufficiently validate the supplied URL address before returning the local file, potentially allowing access to any file on the developer's machine. The middleware can operate with either the physical filesystem (when writeToDisk is set to true) or a virtualized in-memory memfs filesystem. The getFilenameFromUrl method parses the URL and constructs the local file path. Because the URL is not automatically unescaped and normalized before processing, sequences like %2e and %2f can be used to perform a path traversal attack. Developers using webpack-dev-server or webpack-dev-middleware are affected. An attacker could potentially access and exfiltrate files from the developer's machine, especially if the development server is listening on a public IP address or allows access from third-party domains.
Recommendations: Update to webpack-dev-middleware version 7.1.0 or later. Update to webpack-dev-middleware version 6.1.2 or later. Update to webpack-dev-middleware version 5.3.4 or later.

Exploit

Fix

Path traversal

Weakness Enumeration

Related Identifiers

BDU:2024-04278
CVE-2024-29180
GHSA-WR3J-PWJ9-HQQ6

Affected Products

Webpack-Dev-Middleware
Webpack-Dev-Server