CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-76844

CVE-2026-76844: Path Traversal in webpack-dev-middleware via Incomplete Prefix Validation

Amit Schendel
Amit Schendel
Senior Security Researcher

Sep 29, 2026·5 min read·45 visits

Executive Summary (TL;DR)

webpack-dev-middleware suffers from a path traversal flaw when publicPath lacks a trailing slash and physical files are served, allowing attackers to read files one directory above the output root via crafted HTTP requests like GET /assets../.env.

CVE-2026-76844 is a high-severity path traversal vulnerability in webpack-dev-middleware affecting multiple version branches. It stems from an incomplete fix for CVE-2024-29180 when serving files via a physical filesystem with a non-slash-terminated publicPath configuration. Attackers can bypass directory validation to access files situated one level above the intended output directory.

Vulnerability Overview

webpack-dev-middleware is an essential Node.js package that serves assets emitted from a Webpack compiler. It is frequently integrated within development servers like webpack-dev-server to stream assets directly to client browsers during local development cycles.

To ensure proper performance and capability, the middleware exposes an HTTP-accessible surface where requested URIs are dynamically mapped to local files. The mapping logic evaluates raw incoming paths, verifies access permissions, and handles the retrieval of output artifacts. This behavior exposes a critical attack surface if access checks are bypassed.

CVE-2026-76844 represents an incomplete remediation of CVE-2024-29180. Under specific conditions—such as a configuration lacking a trailing slash on the virtual resource path coupled with direct disk-write settings—an unauthenticated network attacker can leverage structured path requests to read local system configuration files situated above the output directory root.

Root Cause Analysis

The root cause of this vulnerability lies in the sequence of input verification and path truncation logic implemented in getFilenameFromUrl. The middleware evaluates if an incoming URI path starts with the specified virtual root directory (publicPath) and tests the raw input string against a validation regular expression (UP_PATH_REGEXP).

This regular expression only detects parent traversal sequences (..) when they are delimited as isolated directory segments (such as /../). If the double dot sequence is nested inside an arbitrary string sequence, it passes this validation check untouched.

When a publicPath is configured without a trailing slash (e.g., /assets), a request targeting /assets../.env evaluates as starting with the prefix /assets. The traversal guard examines the string /assets../.env and permits the request because the string segment assets.. does not match the standalone double-dot pattern.

Following the guard bypass, the application slices the raw path by the exact length of the publicPath prefix (7 characters). This slicing converts /assets../.env into the relative string ../.env, which is subsequently joined with the physical output path, escaping the designated asset sandbox.

Code Path Analysis

The flawed logic is located within the request-handling middleware files where output file paths are derived from URLs. Below is a representation of the vulnerable path derivation flow.

// VULNERABLE CODE PATH
const UP_PATH_REGEXP = /(?:^|[\\/])\.\.(?:[\\/]|$)/;
 
function getFilenameFromUrl(context, url) {
  const pathname = parseUrl(url);
  
  // Check if pathname starts with the public path
  if (pathname.startsWith(publicPathPathname)) {
    // Ensure the raw path has no explicit traversal sequences
    if (UP_PATH_REGEXP.test(pathname)) {
      throw new Error('Forbidden');
    }
    
    // Slicing here strips the prefix and yields relative traversal characters
    const remainder = pathname.slice(publicPathPathname.length);
    const filename = path.join(outputPath, remainder);
    return filename;
  }
}

The fundamental mitigation checks the validity of the computed absolute filepath rather than trying to sanitize the un-stripped request string. This is accomplished using path.relative to enforce folder containment boundaries.

// PATCHED IMPLEMENTATION
const filename = path.join(outputPath, pathname.slice(publicPathPathname.length));
 
// Compute path relative to the defined output root
const relative = path.relative(outputPath, filename);
 
// If the relative path points upwards (..), block the request
if (
  relative === ".." ||
  relative.startsWith(`..${path.sep}`) ||
  path.isAbsolute(relative)
) {
  throw new FilenameError("Forbidden", 403);
}

By comparing the output directory with the final resolved filename, the middleware accurately identifies if the resolved file resides outside the boundaries of the output path. This boundary enforcement renders string manipulation tricks irrelevant.

Exploitation Methodology

Exploitation of CVE-2026-76844 is direct and requires no prior authentication. However, successful retrieval of arbitrary files relies on several configuration prerequisites.

First, the virtual path prefix (publicPath) must be configured to omit a trailing slash (for example, /static instead of /static/). Second, the middleware must execute file reads against a physical disk rather than an in-memory buffer. This condition is satisfied when developers enable the writeToDisk option or pass a native physical file system as the outputFileSystem property.

An attacker sends a formatted HTTP request targeting the root path prefix followed by a double dot sequence and the target filename:

GET /static../.env HTTP/1.1
Host: target-dev-server:8080
Connection: close

Because the browser or client routing libraries collapse paths prior to server-side interpretation, the exploitation is strictly limited to reading files situated exactly one level above the compiled asset output root. Deep traversal via nested paths (e.g. ../../) is neutralized during the standard URL parsing pipeline.

Impact Assessment

This vulnerability exposes high-value intellectual property and configuration secrets stored on development machines and server nodes. Since development environments routinely hold unencrypted environment files (.env), AWS credentials, and database connection strings inside the parent project folder, a single file disclosure can lead to broader infrastructure compromise.

The vulnerability is designated a CVSS v3.1 score of 7.4 (High), with high confidentiality impact. Because the vulnerability permits directory escaping, the Scope metric is evaluated as Changed, indicating that the impact extends beyond the sandboxed memory execution environment of the webpack compilation.

Although the threat of automated internet-wide exploitation is limited by the typical localized deployments of development servers, the exploit is trivial to execute. Remote attackers targeting corporate intranets or phishing developers to execute cross-site requests can successfully exfiltrate sensitive credentials.

Remediation & Mitigation

Remediation requires upgrading the underlying dependency to a version containing the post-resolution containment check. The patch was backported and released in versions 7.4.6 and 8.3.0.

If upgrading is not an immediate option, developers can apply an effective configuration-based workaround. Modifying the publicPath property in the Webpack configuration to include a trailing slash prevents the slice bypass.

// WORKAROUND CONFIGURATION
module.exports = {
  output: {
    // Terminating with a slash isolates prefix comparisons
    publicPath: '/assets/',
  },
};

When a trailing slash is appended, a request targeting /assets../.env fails the pathname.startsWith('/assets/') validation step entirely. The middleware will not process the request as matching the public asset scope, neutralizing the traversal vector.

Official Patches

webpackV8 & V7 patch fixing path traversal containment
webpackAlternative commit implementing relative path checks

Fix Analysis (2)

Technical Appendix

CVSS Score
7.4/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N
EPSS Probability
0.48%
Top 61% most exploited
1,500
via Shodan

Affected Systems

webpack-dev-middleware versions 5.3.4, 6.1.2-6.1.3, 7.1.0-7.4.5, 8.0.0-8.1.1 configured with writeToDisk or custom physical outputFileSystem

Affected Versions Detail

Product
Affected Versions
Fixed Version
webpack-dev-middleware
webpack
>= 5.3.4, <= 8.1.17.4.6, 8.3.0
AttributeDetail
CWE IDCWE-22 (Path Traversal)
Attack VectorNetwork (AV:N)
CVSS v3.17.4 (High)
EPSS Score0.00483
ImpactConfidentiality (High)
Exploit StatusProof-of-Concept (PoC)
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1083File and Directory Discovery
Discovery
T1005Data from Local System
Collection
CWE-22
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

The software uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.

Known Exploits & Detection

GitHub Advisory / Patch TestsIntegration tests illustrating path resolution exploit vector using /static../ test suite cases

Vulnerability Timeline

CVE-2024-29180 initial mitigation released
2024-03-20
CVE-2026-76844 discovered as an incomplete fix bypass
2026-02-15
Vendor security advisory published and patched versions released
2026-02-18

References & Sources

  • [1]GitHub Security Advisory GHSA-wr3j-pwj9-hqq6
  • [2]webpack-dev-middleware Middleware Source File
  • [3]VulnCheck Advisory for webpack-dev-middleware
  • [4]Fix Commit 1 (v8.x/v7.x)
  • [5]Fix Commit 2
Related Vulnerabilities
CVE-2024-29180

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•2 minutes ago•CVE-2026-62297
7.5

CVE-2026-62297: Uncontrolled Memory Allocation and Denial of Service in ag-psd

An uncontrolled memory allocation vulnerability exists in ag-psd versions prior to 31.0.0. When parsing Adobe Photoshop Document (PSD) files, the readPsd() function reads image dimensions and color depth directly from the file header and allocates off-heap typed arrays without validating whether the requested memory size is proportional to the input stream or bounded by operational thresholds. An unauthenticated attacker can supply a crafted 52-byte PSD payload that triggers an immediate 3.35 GB memory allocation, resulting in process termination via the operating system Out-Of-Memory (OOM) killer.

Amit Schendel
Amit Schendel
0 views•10 min read
•about 1 hour ago•CVE-2026-126297
7.5

CVE-2026-126297: Algorithmic Complexity Denial of Service in NLTK ConllCorpusReader

CVE-2026-126297 (GHSA-v8f3-6phw-6mh9) is an uncontrolled resource consumption and algorithmic complexity vulnerability in the Natural Language Toolkit (NLTK) prior to version 3.10.4. Located in the Semantic Role Labeling (SRL) parser within `nltk/corpus/reader/conll.py`, the flaw allows an attacker to trigger quadratic O(N^2) CPU processing overhead by providing crafted CoNLL-formatted corpus inputs containing decoy span columns or nested full-width verb spans. Applications parsing untrusted linguistic corpora can experience prolonged CPU exhaustion and application-level Denial of Service (DoS).

Amit Schendel
Amit Schendel
2 views•12 min read
•about 2 hours ago•CVE-2026-126298
7.5

CVE-2026-126298: Quadratic Algorithmic Complexity Denial of Service in NLTK Tree.chomsky_normal_form

CVE-2026-126298 (also tracked as GHSA-r53h-rw34-8h97) is an algorithmic complexity Denial of Service (DoS) vulnerability in the Natural Language Toolkit (NLTK) Python library affecting all versions prior to 3.10.4. The vulnerability resides in the nltk.tree.transforms.chomsky_normal_form function and its corresponding public method Tree.chomsky_normal_form(). When transforming a parse tree into Chomsky Normal Form using the default right-factoring strategy, the function repeatedly invokes list.pop(0) inside a loop iterating over all children of a node. In CPython, removing the initial element of a standard list requires an O(N) memory shift operation, causing the overall binarization algorithm to degrade to O(N^2) quadratic time complexity relative to the width of a node. Furthermore, converting horizontal node width into vertical tree depth bypasses initial parsing depth bounds, triggering subsequent stack exhaustion (RecursionError) when recursive methods traverse the mutated structure. Unauthenticated remote attackers who can submit bracketed tree strings to applications invoking this transformation can exhaust single-threaded CPU resources or induce unhandled application exceptions.

Alon Barad
Alon Barad
5 views•12 min read
•about 3 hours ago•CVE-2026-126299
7.5

CVE-2026-126299: Quadratic Algorithmic Complexity Denial of Service in NLTK CCG Lexicon Parser

An algorithmic complexity vulnerability (CWE-407) in the Natural Language Toolkit (NLTK) before version 3.10.4 allows remote unauthenticated attackers to cause a denial of service via crafted Combinatory Categorial Grammar (CCG) lexicon strings. The parser in nltk.ccg.lexicon.fromstring performs repeated immutable string slicing, concatenation, and regex tail capturing, resulting in O(n^2) CPU consumption when processing wide, flat category definitions.

Alon Barad
Alon Barad
4 views•10 min read
•about 4 hours ago•CVE-2026-126295
7.1

CVE-2026-126295: Path Traversal and Unconfined File Access in NLTK BllipParser

CVE-2026-126295 (also tracked as GHSA-fg9w-wfp5-j933) is a path confinement bypass vulnerability in the Natural Language Toolkit (NLTK) affecting versions 3.10.0 prior to 3.10.4. The flaw resides in nltk/parse/bllip.py within the BllipParser class and its factory method BllipParser.from_unified_model_dir(). Unlike sibling tool wrappers in NLTK that enforce data-root confinement via the nltk.pathsec module, BllipParser passes caller-supplied filesystem paths directly into the third-party bllipparser native C extension without validation. When an application passes untrusted input as model paths or directories to BllipParser, an attacker can force the native extension to open arbitrary files on the local filesystem. This leads to information disclosure through parser diagnostic oracles, local model tampering via shared directories, and denial of service by hanging worker threads on blocking special files (such as FIFOs or device nodes) or exhausting memory via oversized files.

Amit Schendel
Amit Schendel
2 views•11 min read
•about 5 hours ago•CVE-2026-126300
5.3

CVE-2026-126300: Algorithmic Complexity Denial of Service in NLTK TreebankWordTokenizer.span_tokenize

CVE-2026-126300 (GHSA-ffr9-mgrr-wcvr) is an inefficient algorithmic complexity vulnerability (CWE-407) in the Natural Language Toolkit (NLTK) Python library affecting versions 3.2.5 prior to 3.10.4. The flaw resides in the quote-restoration routine of TreebankWordTokenizer.span_tokenize and NLTKWordTokenizer.span_tokenize, where repeated calls to list.pop(0) over matched quote tokens introduce quadratic O(n^2) time complexity. An unauthenticated remote attacker who supplies input containing long sequences of double-quote characters can exhaust CPU resources and degrade service availability.

Amit Schendel
Amit Schendel
3 views•10 min read