CVE-2024-29180
JavaScript vulnerability analysis and mitigation

Overview

CVE-2024-29180 affects webpack-dev-middleware development middleware for webpack, discovered in March 2024. The vulnerability exists in versions prior to 7.1.0, 6.1.2, and 5.3.4, where the middleware fails to properly validate supplied URL addresses before returning local files. This security flaw affects developers using webpack-dev-server or webpack-dev-middleware (GitHub Advisory).

Technical details

The vulnerability stems from insufficient URL validation in the middleware's file handling process. When the writeToDisk configuration option is set to true, the middleware uses the physical filesystem. The getFilenameFromUrl method, responsible for parsing URLs and building local file paths, fails to properly unescape and normalize URLs before processing. This allows attackers to use %2e and %2f sequences to perform path traversal attacks. The vulnerability has been assigned a CVSS v3.1 base score of 7.4 (High), with a vector string of CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N (GitHub Advisory).

Impact

The vulnerability allows attackers to access any file on a developer's machine and potentially exfiltrate sensitive content, including passwords, configuration files, and private source code. If the development server is listening on a public IP address or 0.0.0.0, attackers on the local network can access local files without victim interaction. Additionally, if the server allows access from third-party domains (CORS, Allow-Access-Origin: *), attackers can exploit the vulnerability through malicious links that, when visited, enable client-side scripts to connect to the local server and exfiltrate files (GitHub Advisory).

Mitigation and workarounds

The vulnerability has been patched in versions 7.1.0, 6.1.2, and 5.3.4. The fix ensures that URLs are properly unescaped and normalized before any further processing. Users are strongly advised to upgrade to these patched versions to prevent unauthorized file access (GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

“Best User Experience I have ever seen, provides full visibility to cloud workloads.”
David EstlickCISO
“Wiz provides a single pane of glass to see what is going on in our cloud environments.”
Adam FletcherChief Security Officer
“We know that if Wiz identifies something as critical, it actually is.”
Greg PoniatowskiHead of Threat and Vulnerability Management