Every CVE Search/ Get API key

CVE-2024-29180

webpack-dev-middleware Path Traversal vulnerability

7.4 HighFix available

Prior to versions 7.1.0, 6.1.2, and 5.3.4, the webpack-dev-middleware development middleware for devpack 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. 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. 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. 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.

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. 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, 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. Starting with fixed versions 7.1.0, 6.1.2, and 5.3.4, the URL is unescaped and normalized before any further processing.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
Required

What an attacker can affect

Confidentiality
High
Integrity
None
Availability
None

Exploit likelihood

1.23%Up 1.2 points since Mar 22, 2024
90%50%10%1%

What each source reports

CVE List Score used 7.4

webpack-dev-middleware Path Traversal vulnerability

Prior to versions 7.1.0, 6.1.2, and 5.3.4, the webpack-dev-middleware development middleware for devpack 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. 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. 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. 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.

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. 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, 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. Starting with fixed versions 7.1.0, 6.1.2, and 5.3.4, the URL is unescaped and normalized before any further processing.

Record
CVE-2024-29180
CVSS 3.1
7.4 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N
Weakness
CWE-22
Updated
2026-11-02
EUVDEUVD-2024-1028 7.4

Prior to versions 7.1.0, 6.1.2, and 5.3.4, the webpack-dev-middleware development middleware for devpack 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. 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. 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. 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.

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. 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, 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. Starting with fixed versions 7.1.0, 6.1.2, and 5.3.4, the URL is unescaped and normalized before any further processing.

Record
EUVD-2024-1028
CVSS 3.1
7.4 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N
Updated
2026-11-03
GitHub AdvisoriesGHSA-wr3j-pwj9-hqq6 7.4

Path traversal in webpack-dev-middleware

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.

Record
GHSA-wr3j-pwj9-hqq6
CVSS 3.1
7.4 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N
Weakness
CWE-22
Updated
2026-11-02
NVD 7.4

Prior to versions 7.1.0, 6.1.2, and 5.3.4, the webpack-dev-middleware development middleware for devpack 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. 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. 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. 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.

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. 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, 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. Starting with fixed versions 7.1.0, 6.1.2, and 5.3.4, the URL is unescaped and normalized before any further processing.

Record
CVE-2024-29180
CVSS 3.1
7.4 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Weakness
CWE-22
Updated
2026-11-02
OSV 7.4

webpack-dev-middleware Path Traversal vulnerability

Prior to versions 7.1.0, 6.1.2, and 5.3.4, the webpack-dev-middleware development middleware for devpack 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. 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. 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. 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.

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. 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, 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. Starting with fixed versions 7.1.0, 6.1.2, and 5.3.4, the URL is unescaped and normalized before any further processing.

Record
CVE-2024-29180
CVSS 3.1
7.4 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N
Weakness
CWE-22
Updated
2026-11-02
OSVGHSA-wr3j-pwj9-hqq6 7.4

Path traversal in webpack-dev-middleware

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.

Record
GHSA-wr3j-pwj9-hqq6
CVSS 3.1
7.4 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N
Weakness
CWE-22
Updated
2026-11-02
Show 15 moreShow less
OSVCLSA-2026-1774311626 No score

TuxCare security update for webpack-dev-middleware (1 CVE)

TuxCare rebuilt webpack-dev-middleware to address 1 CVE. Fixed in 3.7.2-tuxcare.1.

Record
CLSA-2026-1774311626
Updated
2026-11-02
OSVCLSA-2026-1774311628 No score

TuxCare security update for webpack-dev-middleware (1 CVE)

TuxCare rebuilt webpack-dev-middleware to address 1 CVE. Fixed in 5.0.0-tuxcare.1.

Record
CLSA-2026-1774311628
Updated
2026-11-02
OSVCLSA-2026-1774311629 No score

TuxCare security update for webpack-dev-middleware (1 CVE)

TuxCare rebuilt webpack-dev-middleware to address 1 CVE. Fixed in 5.3.0-tuxcare.1.

Record
CLSA-2026-1774311629
Updated
2026-11-02
OSVCLSA-2026-1774311637 No score

TuxCare security update for webpack-dev-middleware (1 CVE)

TuxCare rebuilt webpack-dev-middleware to address 1 CVE. Fixed in 1.12.2-tuxcare.1.

Record
CLSA-2026-1774311637
Updated
2026-11-02
OSVCLSA-2026-1776299675 No score

TuxCare security update for webpack-dev-middleware (1 CVE)

TuxCare rebuilt webpack-dev-middleware to address 1 CVE. Fixed in 3.5.1-tuxcare.1.

Record
CLSA-2026-1776299675
Updated
2026-11-02
OSVCLSA-2026-1776299676 No score

TuxCare security update for webpack-dev-middleware (1 CVE)

TuxCare rebuilt webpack-dev-middleware to address 1 CVE. Fixed in 3.4.0-tuxcare.1.

Record
CLSA-2026-1776299676
Updated
2026-11-02
OSVCLSA-2026-1779238049 No score

TuxCare security update for webpack-dev-middleware (1 CVE)

TuxCare rebuilt webpack-dev-middleware to address 1 CVE. Fixed in 3.7.3-tuxcare.1.

Record
CLSA-2026-1779238049
Updated
2026-11-02
OSVCLSA-2026-1779238056 No score

TuxCare security update for webpack-dev-middleware (1 CVE)

TuxCare rebuilt webpack-dev-middleware to address 1 CVE. Fixed in 5.3.3-tuxcare.1.

Record
CLSA-2026-1779238056
Updated
2026-11-02
OSVCLSA-2026-1784596341 No score

TuxCare security update for webpack-dev-middleware (1 CVE)

TuxCare rebuilt webpack-dev-middleware to address 1 CVE. Fixed in 1.12.0-tuxcare.1.

Record
CLSA-2026-1784596341
Updated
2026-11-02
OSVCLSA-2026-1784856457 No score

TuxCare security update for webpack-dev-middleware (1 CVE)

TuxCare rebuilt webpack-dev-middleware to address 1 CVE. Fixed in 1.10.2-tuxcare.1.

Record
CLSA-2026-1784856457
Updated
2026-11-02
OSVCLSA-2026-1789721764 No score

TuxCare security update for webpack-dev-middleware (1 CVE)

TuxCare rebuilt webpack-dev-middleware to address 1 CVE. Fixed in 1.11.0-tuxcare.1.

Record
CLSA-2026-1789721764
Updated
2026-11-02
OSVCLSA-2026-1790520250 No score

TuxCare security update for webpack-dev-middleware (1 CVE)

TuxCare rebuilt webpack-dev-middleware to address 1 CVE. Fixed in 3.0.1-tuxcare.1.

Record
CLSA-2026-1790520250
Updated
2026-11-02
OSVCLSA-2026-1790866070 No score

TuxCare security update for webpack-dev-middleware (1 CVE)

TuxCare rebuilt webpack-dev-middleware to address 1 CVE. Fixed in 6.1.3-tuxcare.1.

Record
CLSA-2026-1790866070
Updated
2026-11-02
OSVCLSA-2026-1790866099 No score

TuxCare security update for webpack-dev-middleware (1 CVE)

TuxCare rebuilt webpack-dev-middleware to address 1 CVE. Fixed in 5.3.4-tuxcare.2.

Record
CLSA-2026-1790866099
Updated
2026-11-02
OSVROOT-APP-NPM-CVE-2024-29180 No score

CVE-2024-29180 in webpack-dev-middleware - Patched by Root

Root has patched CVE-2024-29180 in the webpack-dev-middleware package for Root:npm. Multiple fixed versions available.

Record
ROOT-APP-NPM-CVE-2024-29180
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
webpack-dev-middleware
npm
7.0.0 up to 7.1.0
7.1.0
webpack-dev-middleware
npm
6.0.0 up to 6.1.2
6.1.2
webpack-dev-middleware
npm
through 5.3.3
5.3.4
webpack-dev-middleware
TuxCare:npm
3.7.2-tuxcare.0 up to 3.7.2-tuxcare.1, plus listed versions
3.7.2
3.7.2-tuxcare.1
webpack-dev-middleware
TuxCare:npm
5.0.0-tuxcare.0 up to 5.0.0-tuxcare.1, plus listed versions
5.0.0
5.0.0-tuxcare.1
webpack-dev-middleware
TuxCare:npm
5.3.0-tuxcare.0 up to 5.3.0-tuxcare.1, plus listed versions
5.3.0
5.3.0-tuxcare.1
webpack-dev-middleware
TuxCare:npm
1.12.2-tuxcare.0 up to 1.12.2-tuxcare.1, plus listed versions
1.12.2
1.12.2-tuxcare.1
webpack-dev-middleware
TuxCare:npm
3.5.1-tuxcare.0 up to 3.5.1-tuxcare.1, plus listed versions
3.5.1
3.5.1-tuxcare.1
webpack-dev-middleware
TuxCare:npm
3.4.0-tuxcare.0 up to 3.4.0-tuxcare.1, plus listed versions
3.4.0
3.4.0-tuxcare.1
webpack-dev-middleware
TuxCare:npm
3.7.3-tuxcare.0 up to 3.7.3-tuxcare.1, plus listed versions
3.7.3
3.7.3-tuxcare.1
Show 10 moreShow less
Affected packages
PackageAffectedFixed
webpack-dev-middleware
TuxCare:npm
5.3.3-tuxcare.0 up to 5.3.3-tuxcare.1, plus listed versions
5.3.3
5.3.3-tuxcare.1
webpack-dev-middleware
TuxCare:npm
1.12.0-tuxcare.0 up to 1.12.0-tuxcare.1, plus listed versions
1.12.0
1.12.0-tuxcare.1
webpack-dev-middleware
TuxCare:npm
1.10.2-tuxcare.0 up to 1.10.2-tuxcare.1, plus listed versions
1.10.2
1.10.2-tuxcare.1
webpack-dev-middleware
TuxCare:npm
1.11.0-tuxcare.0 up to 1.11.0-tuxcare.1, plus listed versions
1.11.0
1.11.0-tuxcare.1
webpack-dev-middleware
TuxCare:npm
3.0.1-tuxcare.0 up to 3.0.1-tuxcare.1, plus listed versions
3.0.1
3.0.1-tuxcare.1
webpack-dev-middleware
TuxCare:npm
6.1.3-tuxcare.0 up to 6.1.3-tuxcare.1, plus listed versions
6.1.3
6.1.3-tuxcare.1
webpack-dev-middleware
TuxCare:npm
5.3.4-tuxcare.0 up to 5.3.4-tuxcare.2, plus listed versions
5.3.45.3.4-tuxcare.1
5.3.4-tuxcare.2
webpack-dev-middleware
npm
before 5.3.4
5.3.4
webpack-dev-middleware
Root:npm
before 3.7.2-aikido.1
3.7.2-aikido.14.3.0-aikido.23.7.3-aikido.24.3.0-aikido.33.7.2-aikido.23.7.3-aikido.3
@rootio/webpack-dev-middleware
Root:npm
before 3.7.2-root.io.1
3.7.2-root.io.14.3.0-root.io.13.7.3-root.io.14.3.0-root.io.23.7.3-root.io.24.3.0-root.io.33.7.2-root.io.23.7.3-root.io.3

History

History
RecordedChangedSources
aliases, publishedEUVD
first indexedCVE List, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2024-29180 is a high vulnerability (CVSS 7.4) in Webpack Webpack-dev-middleware, published March 21, 2024. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.23%, the 69th percentile. Fixed in webpack-dev-middleware 7.1.0.

References

Show 7 moreShow less
MoveEnter Open