NIST deprecates RSA-2048 from 2030. Find every one of them before attackers do.
📦
📦 npm
Not in CISA KEV
HIGH severity

CVE-2024-29180 — webpack-dev-middleware

HIGHFix: webpack/webpack-dev-middleware@189c4ac

CVE-2024-29180 is a high-severity (CVSS 7.4) Path Traversal vulnerability in webpack-dev-middleware. A fix is available for webpack-dev-middleware — see the affected versions and patch details below.

webpack-dev-middleware Path Traversal vulnerability

Also known asGHSA-wr3j-pwj9-hqq6
Published
Updated
Affected
3 pkgs
Patched
3 / 3
Exploits
None indexed
Exploitation data as of Nov 2, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Exploitation Status

Proof-of-concept exploit code exists

  • CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.

Exploitation and automatability from CISA’s SSVC triage for CVE-2024-29180.

EPSS Exploitation Probability

via FIRST.org ↗
1.2%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs69th percentile — riskier than 69% of all scored CVEsHighest risk
0.51%1.73%2.95%4.17%3.4%1.2%May 26Sep 26Nov 26

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

How urgent is this, really

Where this sits among everything scored

Real-World Exposure

3 pkgs affected

How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.

3Kother npm packages depend on this — each one inherits the vulnerability until it's patched upstream
webpack-dev-middlewarenpm
28.8Mdownloads / week

Description

Summary

The webpack-dev-middleware middleware does not validate the supplied URL address sufficiently before returning the local file. It is possible to access any file on the developer's machine.

Details

The middleware can either work with the physical filesystem when reading the files or it can use a virtualized in-memory memfs filesystem. If writeToDisk configuration option is set to true, the physical filesystem is used: https://github.com/webpack/webpack-dev-middleware/blob/7ed24e0b9f53ad1562343f9f517f0f0ad2a70377/src/utils/setupOutputFileSystem.js#L21

The getFilenameFromUrl method is used to parse URL and build the local file path. The public path prefix is stripped from the URL, and the unsecaped path suffix is appended to the outputPath: https://github.com/webpack/webpack-dev-middleware/blob/7ed24e0b9f53ad1562343f9f517f0f0ad2a70377/src/utils/getFilenameFromUrl.js#L82 As the URL is not unescaped and normalized automatically before calling the midlleware, it is possible to use %2e and %2f sequences to perform path traversal attack.

PoC

A blank project can be created containing the following configuration file webpack.config.js: module.exports = { devServer: { devMiddleware: { writeToDisk: true } } };

When started, it is possible to access any local file, e.g. /etc/passwd: $ curl localhost:8080/public/..%2f..%2f..%2f..%2f../etc/passwd

root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin

Impact

The developers using webpack-dev-server or webpack-dev-middleware are affected by the issue. When the project is started, an attacker might access any file on the developer's machine and exfiltrate the content (e.g. password, configuration files, private source code, ...).

If the development server is listening on a public IP address (or 0.0.0.0), an attacker on the local network can access the local files without any interaction from the victim (direct connection to the port).

If the server allows access from third-party domains (CORS, Allow-Access-Origin: * ), an attacker can send a malicious link to the victim. When visited, the client side script can connect to the local server and exfiltrate the local files.

Recommendation

The URL should be unescaped and normalized before any further processing.

Affected Packages

3 total 3 fixed
EcosystemPackageVulnerable rangeFix
📦npmwebpack-dev-middleware≥ 7.0.0&&< 7.1.07.1.0npm install webpack-dev-middleware@7.1.0
📦npmwebpack-dev-middleware≥ 6.0.0&&< 6.1.26.1.2npm install webpack-dev-middleware@6.1.2
📦npmwebpack-dev-middlewareall versions5.3.4npm install webpack-dev-middleware@5.3.4

Affected Products

1 product · 3 configurations
Application
webpack-dev-middlewarewebpack.js
≥ 7.0.0 && < 7.1.0
range

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for webpack-dev-middleware, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update webpack-dev-middleware to 7.1.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2024-29180 is resolved across your whole dependency graph.

  3. Workarounds

    Resolve every user-supplied path to its canonical form and reject anything that escapes the intended directory, and run the component under an account that has no read or write access outside the directory it legitimately serves.

Fixing This On Your OS

If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.

Red HatImportant

The vulnerability in webpack-dev represents a important security issue due to its potential to expose sensitive files and compromise developer machines. By failing to validate URLs and normalize paths effectively, the middleware allows attackers to craft malicious requests that can retrieve arbitrary local files or…

Workaround published by Red Hat
Mitigation for this issue is either not available or the currently available options don't meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.
Source: Red Hat security advisory for CVE-2024-29180 (CC BY 4.0)
ProductFixed inAdvisory
Migration Toolkit for Runtimes 1 on RHEL 8webpack-dev-middlewareRHSA-2024:3920
MTA-6.2-RHEL-9mta/mta-ui-rhel9:6.2.3-2RHSA-2024:3989
MTA-7.0-RHEL-9mta/mta-cli-rhel9:7.0.3-16RHSA-2024:3316
NETWORK-OBSERVABILITY-1.6.0-RHEL-9network-observability/network-observability-cli-rhel9:v1.6.0-66RHSA-2024:3868
OpenShift-Pipelines-1.16-RHEL-8openshift-pipelines/pipelines-chains-controller-rhel8:v1.16.0-6RHEA-2024:7870
Red Hat Advanced Cluster Security 4.4advanced-cluster-security/rhacs-central-db-rhel8:4.4.2-4RHSA-2024:2941
Red Hat build of Apicurio Registry 2.6.1 GAwebpack-dev-middlewareRHSA-2024:4873
Red Hat Data Gridwebpack-dev-middlewareRHSA-2024:4460

Frequently Asked Questions

### Summary _The **webpack-dev-middleware** middleware does not validate the supplied URL address sufficiently before returning the local file. It is possible to access any file on the developer's machine._ ### Details The middleware can either work with the physical filesystem when reading the files or it can use a virtualized in-memory _memfs_ filesystem. If _writeToDisk_ configuration option is set to **true**, the physical filesystem is used: [https://github.com/webpack/webpack-dev-middleware/blob/7ed24e0b9f53ad1562343f9f517f0f0ad2a70377/src/utils/setupOutputFileSystem.js#L21](https://git
O3 Security · Impact-Aware SCA

Is CVE-2024-29180 in your dependencies?

Find it across npm, including transitive dependencies.

CVE-2024-29180: webpack-dev — Fixed in 7.1.0