Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2026-76844: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in webpack webpack-dev-middleware

0
High
VulnerabilityCVE-2026-76844cvecve-2026-76844
Published: 08/24/2026 (08/24/2026, 13:12:01 UTC)
Source: CVE Database V5
Vendor/Project: webpack
Product: webpack-dev-middleware

Description

webpack-dev-middleware resolves a request to a local file in getFilenameFromUrl by testing the request pathname against a traversal guard and then slicing it at a fixed character offset. The guard, UP_PATH_REGEXP applied to path.normalize(`./${pathname}`), only matches ".." that stands as a whole path segment, while the containment test is the string comparison pathname.startsWith(publicPathPathname) and the file path is built as path.join(outputPath, pathname.slice(publicPathPathname.length)). When the configured publicPath has no trailing slash, a request such as GET /assets../.env against publicPath /assets yields the pathname /assets../.env, whose only dot-dot sits inside the segment "assets.." and so passes the guard, but the offset slice cuts within that segment and hands "../.env" to path.join, resolving one directory above outputPath. Reading a file from that path requires the middleware to be backed by the physical filesystem, which happens when writeToDisk is true or a custom outputFileSystem is supplied, since the default memfs volume holds only build output. Traversal depth is limited to a single directory because a separately delimited dot-dot segment is collapsed during URL parsing before the guard runs. The default publicPath value of "auto" resolves to "/" and is not affected. This is an incomplete fix for CVE-2024-29180: the guard and offset slice were introduced by that fix and are present in every release from 5.3.4, 6.1.2 and 7.1.0 onward.

CVSS v4.0

Score 8.3high

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
Passive
Vuln. Confidentiality
High
Vuln. Integrity
None
Vuln. Availability
None
Subsq. Confidentiality
High
Subsq. Integrity
None
Subsq. Availability
None
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:N/VA:N/SC:H/SI:N/SA:N

Affected software

webpack-dev-middleware
pkg:npm/webpack-dev-middleware
Affected versions
>=5.3.4 <=5.3.4>=6.1.2 <=6.1.3>=7.1.0 <=7.4.5>=8.0.0 <=8.1.1

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 08/24/2026, 13:37:26 UTC

Technical Analysis

The vulnerability arises because webpack-dev-middleware's pathname traversal guard only matches ".." as a whole path segment and slices the pathname at a fixed offset based on the publicPath length. When publicPath lacks a trailing slash, crafted requests like GET /assets../.env can bypass the guard, resulting in path.join resolving to a directory above the intended outputPath. This allows reading files outside the restricted directory if the middleware uses the physical filesystem backing (e.g., writeToDisk=true). The traversal depth is limited to one directory due to URL parsing collapsing dot-dot segments. This vulnerability is present in versions from 5.3.4, 6.1.2, and 7.1.0 onward and represents an incomplete fix of CVE-2024-29180.

Potential Impact

An attacker can read files outside the intended directory served by webpack-dev-middleware if the middleware is configured to write to disk or uses a custom outputFileSystem backed by the physical filesystem. This can lead to unauthorized disclosure of sensitive files on the server. The vulnerability does not allow code execution or privilege escalation but poses a high confidentiality impact due to potential exposure of sensitive data.

Mitigation Recommendations

Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, avoid configuring webpack-dev-middleware with a publicPath that lacks a trailing slash and avoid enabling writeToDisk or using a physical filesystem backing if possible. Monitor vendor advisories for updates and apply official patches once released.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
VulnCheck
Date Reserved
2026-08-19T20:34:19.724Z
Cvss Version
4.0
State
PUBLISHED
Remediation Level
null

Threat ID: 6a8c45b3acd9273b49946349

Added to database: 08/24/2026, 13:22:59 UTC

Last enriched: 08/24/2026, 13:37:26 UTC

Last updated: 08/24/2026, 21:06:44 UTC

Views: 8

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses