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-4926

CVE-2026-4926: Regular Expression Denial of Service in pillarjs path-to-regexp

Amit Schendel
Amit Schendel
Senior Security Researcher

Mar 28, 2026·6 min read·40 visits

Executive Summary (TL;DR)

CVE-2026-4926 is a ReDoS flaw in path-to-regexp (v8.0.0-8.3.0) causing CPU and memory exhaustion via exponential expansion of optional groups. Upgrading to 8.4.0 resolves the issue via trie-based deduplication and a hard permutation limit.

The path-to-regexp library versions 8.0.0 through 8.3.0 suffer from a high-severity Regular Expression Denial of Service (ReDoS) vulnerability. This flaw stems from an exponential combinatorial explosion when parsing sequential optional groups, leading to severe CPU and memory exhaustion.

Vulnerability Overview

The path-to-regexp library serves as a core routing dependency for major Node.js frameworks, including Express and Koa. It processes string-based route definitions and converts them into regular expressions for path matching. CVE-2026-4926 identifies a Denial of Service (DoS) vulnerability present in versions 8.0.0 through 8.3.0 of this library.

The vulnerability is classified under CWE-400 (Uncontrolled Resource Consumption) and CWE-1333 (Inefficient Regular Expression Complexity). It manifests when the parser evaluates route patterns containing multiple sequential optional groups. The parsing logic fails to constrain the permutations generated from these optional components.

During processing, affected versions expand optional groups into all possible combinations to construct the final regular expression. This mechanism results in an exponential increase in CPU and memory usage as the number of optional groups grows. The resulting resource exhaustion leads to complete application unavailability.

Root Cause Analysis

The root cause of CVE-2026-4926 resides within the flatten function of the library's parser. In version 8, optional groups enclosed in curly braces trigger an expansion process. This process creates a distinct branch for every possible state of the optional group, attempting to map all valid path combinations.

The branching logic results in an exponential growth factor of 2^N, where N represents the number of sequential optional groups. A pattern containing 25 optional groups generates approximately 33 million permutations. A pattern with 50 groups pushes this number beyond one quadrillion discrete permutations.

The library processes these permutations by converting each into a full regular expression string and concatenating them using the logical OR operator. This methodology creates an excessively long final regular expression. The memory required to store and compile this massive string quickly exceeds the allocation limits of the V8 JavaScript engine.

The memory exhaustion leads to immediate process termination via Out Of Memory (OOM) errors. Furthermore, the generated regular expressions frequently contain overlapping capture groups with greedy quantifiers. This causes the V8 engine to enter catastrophic backtracking states, consuming 100% of available CPU cycles when evaluated against specific inputs.

Code Analysis

The vulnerability was addressed in version 8.4.0 through three targeted architectural changes. The primary fix, implemented in commit 43669ac637fe70fad33693d145a74d98179152ce, replaces the naive string concatenation with a trie-based deduplication strategy. This structural change targets the memory consumption aspect of the vulnerability.

The introduction of the SourceNode object allows the parser to merge common prefixes instead of generating distinct branches for every permutation. By organizing the permutations into a trie structure, the output regular expression string length remains proportional to the input complexity. This eliminates the combinatorial memory exhaustion.

// Conceptual representation of the deduplication logic introduced in 8.4.0
class SourceNode {
  constructor() {
    this.children = new Map();
    this.isEnd = false;
  }
  // Common prefixes are merged into the same tree branches
  add(tokens) {
    // Implementation merges sequential nodes to avoid 2^N branch duplication
  }
}

The secondary fix, implemented in commit 22a967901afc8b2b42eefe456faa7b6773dcc415, introduces a defensive hard limit on the number of path combinations. The parser tracks the permutation count and throws a PathError if the predefined threshold is exceeded.

// Excerpt representing the combination limit enforcement
let combinations = 1;
for (const token of tokens) {
  if (token.type === 'optional') {
    combinations *= 2;
    if (combinations > 256) {
      throw new TypeError('Too many path combinations');
    }
  }
}

This limit of 256 combinations serves as a fail-safe against deeply nested or highly complex patterns that might evade the deduplication logic. A concurrent commit refactored the toRegExpSource function to restrict repeated wildcard backtracking by replacing greedy quantifiers with lazy quantifiers.

Exploitation Methodology

Exploitation requires the attacker to supply a crafted route pattern to a vulnerable application endpoint. The target application must either accept user-controlled route definitions or process untrusted input against statically defined routes containing numerous optional groups. The attack does not require authentication or elevated privileges.

The standard proof-of-concept payload consists of a repeating sequence of optional groups. An attacker transmits a payload such as {/a}{/b}{/c}{/d} repeated extensively. When the application passes this payload to pathToRegexp(), the parser immediately begins the exponential expansion process.

// Proof of Concept Payload
{/a}{/b}{/c}{/d}{/e}{/f}{/g}{/h}{/i}{/j}{/k}{/l}{/m}{/n}{/o}{/p}{/q}{/r}{/s}{/t}{/u}{/v}{/w}{/x}{/y}{/z}

The Node.js single-threaded event loop becomes completely blocked during the generation and compilation of the regular expression. This prevents the application from processing any subsequent HTTP requests. The process ultimately crashes due to an Out Of Memory error or hangs indefinitely due to continuous CPU consumption.

Impact Assessment

The successful exploitation of CVE-2026-4926 results in a complete Denial of Service condition. The application becomes unresponsive to all legitimate user traffic while the CPU and memory resources are consumed by the regular expression engine. This impact extends to all services hosted within the affected Node.js process.

The single-threaded nature of Node.js exacerbates the impact of this vulnerability. A single malicious request blocks the main thread, affecting all active concurrent connections. The application instance is rendered entirely unavailable until the process is forcefully restarted by the operating system or a container orchestration system.

The CVSS v3.1 vector is CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H, resulting in a base score of 7.5. The vulnerability requires no privileges, involves no user interaction, and possesses a low attack complexity. The impact is strictly isolated to the Availability metric, with no direct threat to Confidentiality or Integrity.

The EPSS score stands at 0.0004, placing it in the 12.15th percentile. While active exploitation in the wild is currently assessed as low, the widespread adoption of path-to-regexp across the Node.js ecosystem presents a substantial attack surface. Applications exposing route definitions to external input are at immediate risk.

Remediation and Mitigation

The primary remediation strategy requires upgrading the path-to-regexp dependency to version 8.4.0 or later. Organizations utilizing frameworks such as Express or Koa must ensure their package lockfiles resolve to the patched version. Dependency trees should be audited using standard package management tools to confirm the removal of vulnerable versions.

Application architectures must enforce strict input validation and sanitization on all route definitions. Developers must never pass untrusted, user-controlled input directly to pathToRegexp() or any underlying routing mechanisms. Dynamic route generation based on user input represents an inherent anti-pattern and should be avoided.

Route definitions should be reviewed to minimize the use of sequential optional groups. Simplifying route structures reduces both parsing overhead and the potential attack surface for resource consumption flaws. Explicit, well-defined routes are preferable to complex wildcard combinations.

Security teams should integrate static analysis tools, such as recheck, into their CI/CD pipelines. These tools analyze regular expressions for complexity limits and can detect the introduction of similar ReDoS vulnerabilities during the development lifecycle.

Official Patches

OpenJS FoundationOfficial OpenJS Foundation Security Advisory
pillarjsGitHub Repository for path-to-regexp

Fix Analysis (2)

Technical Appendix

CVSS Score
7.5/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
EPSS Probability
0.04%
Top 88% most exploited

Affected Systems

Node.js applications using path-to-regexp versions 8.0.0 through 8.3.0Express.js ecosystem relying on vulnerable versionsKoa ecosystem relying on vulnerable versions

Affected Versions Detail

Product
Affected Versions
Fixed Version
path-to-regexp
pillarjs
>= 8.0.0, <= 8.3.08.4.0
AttributeDetail
CWECWE-1333 / CWE-400
Attack VectorNetwork
CVSS7.5 (High)
EPSS Score0.0004 (12.15%)
ImpactAvailability (Denial of Service)
Exploit StatusProof of Concept available
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1499Endpoint Denial of Service
Impact
CWE-1333
Inefficient Regular Expression Complexity

The software uses a regular expression that is vulnerable to a Denial of Service (DoS) attack, typically via exponential or polynomial backtracking.

Known Exploits & Detection

Research ReportProof of concept demonstrating exponential resource consumption using sequential optional groups.

Vulnerability Timeline

Early refactoring of repository infrastructure begins.
2025-09-05
Commit 4864654 restricts wildcard backtracking.
2026-03-26
Commit 43669ac introduces trie-based prefix deduplication.
2026-03-26
Commit 22a9679 adds the 256-combination hard limit.
2026-03-26
Version 8.4.0 is officially released.
2026-03-26
CVE-2026-4926 is published and assigned.
2026-03-26

References & Sources

  • [1]OpenJS Foundation Security Advisories
  • [2]GitHub Repository: pillarjs/path-to-regexp
  • [3]Fix Commit - Dedupe
  • [4]Fix Commit - Limit
  • [5]CVE Record: CVE-2026-4926

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

•about 4 hours ago•CVE-2026-48861
2.1

CVE-2026-48861: HTTP Request Splitting and Smuggling via Method Parameter CRLF Injection in Elixir Mint

CVE-2026-48861 is a client-side HTTP request-line CRLF (Carriage Return Line Feed) injection vulnerability in the popular Elixir HTTP client library, Mint. The vulnerability permits HTTP Request Splitting and HTTP Request Smuggling when an application forwards untrusted, attacker-controlled inputs to Mint's HTTP client requests as either the HTTP request method or target. By embedding CRLF characters within these parameters, an attacker can terminate the request line prematurely, inject malicious headers, or pipeline entirely independent requests. These smuggled requests are then processed by upstream or downstream proxy servers as separate HTTP queries on the same TCP connection. While Mint version 1.7.0 introduced target validation to secure the request target, the HTTP request method parameter remained completely unvalidated. This flaw allows attackers to bypass routing filters, access restricted internal APIs, or poison HTTP caches under default configurations.

Amit Schendel
Amit Schendel
4 views•7 min read
•about 4 hours ago•CVE-2026-49753
6.3

CVE-2026-49753: HTTP Request/Response Smuggling via Inconsistent Content-Length Parsing in Elixir Mint Client

An Inconsistent Interpretation of HTTP Requests (HTTP Request/Response Smuggling) vulnerability in the Elixir Mint HTTP client allows attacker-controlled HTTP/1 servers to desynchronize response framing on shared connections due to over-lenient parsing of sign-prefixed Content-Length headers.

Amit Schendel
Amit Schendel
6 views•6 min read
•about 5 hours ago•CVE-2026-49754
8.2

CVE-2026-49754: Denial of Service via Unbounded HTTP/2 CONTINUATION Frame Accumulation in Elixir Mint

An allocation of resources without limits or throttling vulnerability in Elixir Mint allows an attacker-controlled HTTP/2 server to exhaust memory in a Mint client. The vulnerability is exploited by sending a HEADERS frame without the END_HEADERS flag followed by an infinite stream of CONTINUATION frames. Because the client lacks limits on the incoming header-block accumulator, the client continuously consumes memory until an out-of-memory crash occurs.

Amit Schendel
Amit Schendel
7 views•6 min read
•about 5 hours ago•CVE-2026-48596
2.1

CVE-2026-48596: Improper Neutralization of CRLF Sequences in Elixir Tesla Multipart HTTP Client

CVE-2026-48596 is an Improper Neutralization of CRLF Sequences in HTTP Headers (HTTP Request/Response Splitting, CWE-113) in the Elixir Tesla HTTP client. The flaw resides in how multipart content-type parameters are joined and serialized, enabling attackers to inject arbitrary headers or split HTTP requests when applications pass untrusted inputs to the parameters of multipart uploads.

Alon Barad
Alon Barad
5 views•6 min read
•about 6 hours ago•CVE-2026-48594
8.2

CVE-2026-48594: Decompression Bomb Denial of Service in Elixir Tesla HTTP Client

An improper handling of highly compressed data (decompression bomb) vulnerability exists in the Elixir Tesla HTTP client when utilizing response decompression middlewares. By serving highly compressed responses or stacked content-encoding headers, a malicious server can cause arbitrary heap exhaustion, leading to a denial of service (DoS) crash in the BEAM virtual machine.

Amit Schendel
Amit Schendel
6 views•6 min read
•about 6 hours ago•CVE-2026-48595
8.2

CVE-2026-48595: Cross-Origin Credential Leakage in Elixir Tesla Client via Case-Sensitive Redirect Filter Bypass

A high-severity security vulnerability in Elixir's Tesla HTTP client library (CVE-2026-48595) allows unauthenticated remote attackers to harvest sensitive credentials, including Authorization headers and cookies. The flaw resides in the 'Tesla.Middleware.FollowRedirects' component, which performs case-sensitive lookups when stripping credentials during cross-origin redirects. Because HTTP headers are case-insensitive by RFC specifications, standard canonical casing (e.g., 'Authorization') bypasses the lowercase-only blocklist, leaking tokens to untrusted external redirect destinations.

Alon Barad
Alon Barad
6 views•5 min read