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

CVE-2026-102277: Denial of Service via Quadratic Algorithmic Complexity in brace-expansion

Amit Schendel
Amit Schendel
Senior Security Researcher

Sep 30, 2026·7 min read·48 visits

Executive Summary (TL;DR)

The brace-expansion JavaScript library suffers from an O(N^2) quadratic complexity vulnerability when parsing legacy {a},b}-shaped structures with many trailing braces. This allows remote attackers to trigger a Denial of Service by blocking the single-threaded Node.js event loop.

An uncontrolled resource consumption vulnerability exists in the brace-expansion JavaScript library. Due to an algorithmic flaw in parsing a legacy Bash-compatibility quirk involving {a},b}-shaped expansion structures, untrusted inputs containing many trailing closing braces trigger successive full-input rescans. This behavior yields quadratic CPU time complexity and high memory overhead, allowing remote, unauthenticated attackers to cause a Denial of Service (DoS) by blocking the single-threaded Node.js event loop.

Vulnerability Overview and Context

The brace-expansion JavaScript library is a widely utilized package designed to perform shell-like brace expansion, mirroring the behavior found in shells such as sh and bash. It is a foundational utility used extensively in pattern matching and file expansion within Node.js ecosystems, often serving as a dependency for libraries like minimatch and glob.

The vulnerability is classified under CWE-400 (Uncontrolled Resource Consumption) and CWE-407 (Inefficient Algorithmic Complexity). It manifests when the parser attempts to resolve a legacy compatibility quirk. When processing a specific structure containing a sequence of trailing closing braces and a trailing comma set, the parsing state machine falls back to an inefficient iterative rewriting scheme.

An attacker capable of submitting arbitrary strings to any application interface that processes inputs via brace-expansion can exploit this flaw. Because Node.js is single-threaded, blocking the event loop with this computationally intensive processing loop prevents the runtime from handling concurrent network connections, leading to application-wide denial of service.

Root Cause Analysis

Bash retains a legacy behavior where a brace group followed by a comma set expansions despite not forming a standard option or sequence set. For example, the expression {a},b} expands into a} and b. To replicate this quirk, the brace-expansion parser identifies potential {a},b}-shaped patterns, performs an in-place string modification, and restarts the scanner loop from the beginning of the string.

When an attacker provides a payload consisting of a single valid brace group, followed by a large number of trailing closing braces, and a terminating comma set (such as '{a}' + '}'.repeat(N) + ',z}'), the parser becomes trapped in a recursive-like loop. On the first pass, the parser detects the group {a}. Because the substring after this group contains a comma and a closing brace, it matches the legacy pattern, replaces the first closing brace with an escaped sentinel string (escClose), and restarts the scan.

On the subsequent pass, the parser scans from the beginning. It bypasses the previously escaped brace and treats the next literal trailing closing brace as the group terminator. This second brace is rewritten, and the scan restarts again. This process repeats for every single trailing closing brace in the input string.

This behavior has severe performance implications. For an input with N trailing braces, the parser performs N complete rescans of the entire string, resulting in quadratic time complexity ($O(N^2)$). Furthermore, because each rewrite replaces a single-byte closing brace with a multi-byte escClose sentinel string (approximately 25 characters), the size of the processing string expands linearly, creating significant heap allocation overhead and garbage collection pressure.

Source Code Walkthrough

The vulnerability lies within the core parsing routine, specifically inside the nested matching loop. Before the patch, the parser evaluated the legacy Bash pattern and triggered an unrestricted continuation loop without tracking iteration depth or frequency.

// Vulnerable code pattern
const isOptions = m.body.indexOf(',') >= 0
if (!isSequence && !isOptions) {
  // Pattern identified as {a},b}
  if (m.post.match(/,(?!,).*\}/)) {
    str = m.pre + '{' + m.body + escClose + m.post
    isTop = true
    continue // Scan is restarted from the beginning without a limit
  }
}

The official remediation introduces EXPANSION_MAX_REWRITES to bound the scan restarts. Below is the annotated patched code structure demonstrating the restriction placed on loop iterations:

// Patched code pattern
export const EXPANSION_MAX_REWRITES = 1000
 
function expand (str, max, maxLength, maxDepth, depth, maxRewrites, isTop) {
  let rewrites = 0
  
  // ... inner parser loop ...
  
    const isOptions = m.body.indexOf(',') >= 0
    if (!isSequence && !isOptions) {
      // Check the rewrite limit before attempting legacy modification
      if (rewrites < maxRewrites && m.post.match(/,(?!,).*\}/)) {
        rewrites++
        str = m.pre + '{' + m.body + escClose + m.post
        isTop = true
        continue // Restarts scan, but capped at 1000 iterations
      }
    }

By capping the iteration count, the parser prevents unbounded execution on malicious inputs. Once the threshold of 1000 rewrites is exceeded, the parser ceases rewriting, exits the loop, and processes the remaining segment as a literal string.

Exploitation and Proof-of-Concept

To exploit this vulnerability, an attacker must submit a structured payload containing a leading simple brace group, a high count of consecutive closing braces, and a final comma set. Because the payload relies solely on common characters, it easily bypasses standard sanitization mechanisms that only look for malicious command sequences or script tags.

const expand = require('brace-expansion');
 
// Construct a payload containing 80,000 trailing braces
const n = 80000;
const payload = '{a}' + '}'.repeat(n) + ',z}';
 
console.log(`[+] Running expansion with ${n} trailing braces...`);
const startTime = performance.now();
 
// Trigger the vulnerable parsing loop
const result = expand(payload);
 
const endTime = performance.now();
console.log(`[+] Completed in ${(endTime - startTime).toFixed(2)} ms`);

When executed on an unpatched environment, the single-threaded Node.js event loop blocks entirely. During this execution window, the application is unable to process incoming requests, complete asynchronous database queries, or respond to health check probes. This leads to connection timeouts and service unresponsiveness.

Patch Analysis and Residual Risks

The mitigation successfully blocks the infinite rewriting path by enforcing EXPANSION_MAX_REWRITES = 1000. However, security engineers should consider the architectural implications of how the state is tracked.

The rewrites variable is scoped locally within each execution context of the recursive expand function. When processing nested expansion sequences, each nested call receives its own independent allocation of 1000 rewrites. An attacker can theoretically design a multi-layered nested structure to bypass the 1000-rewrite ceiling globally, though the total impact is bounded by the separate EXPANSION_MAX_DEPTH (1000) and EXPANSION_MAX_LENGTH (4,000,000) limits.

Another residual behavior is that when the rewrite limit is reached, the library silently stops expanding and treats the remaining portion literally. If downstream components expect fully expanded arrays for access control or command parsing, this behavior can introduce parser differential issues where the application logic processes the literal string representation differently than intended.

Remediation and Defensive Guidance

The primary remediation step is to upgrade the brace-expansion dependency to a safe release version. The fix has been backported across all active branches to maintain backward compatibility.

# Verify dependency status and upgrade paths
npm audit
 
# Upgrade brace-expansion to the latest patched version
npm install brace-expansion@latest

If immediate dependency updates are not possible, deploy a Web Application Firewall (WAF) rule to block incoming request parameters containing repetitive closing braces. The following pattern matches payloads trying to exploit this behavior:

\{[^}]+\}[}]{10,}.*,

This regex detects the necessary sequence of a valid brace group, followed by ten or more consecutive closing braces, followed by a trailing comma, allowing security teams to drop matching requests at the edge.

Fix Analysis (4)

Technical Appendix

CVSS Score
5.3/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
EPSS Probability
0.30%
Top 79% most exploited

Affected Systems

Applications utilizing brace-expansion in Node.js environments for path or glob matchingDownstream packages like minimatch and glob utilizing vulnerable versions of brace-expansion

Affected Versions Detail

Product
Affected Versions
Fixed Version
brace-expansion
Julian Gruber
< 1.1.211.1.21
brace-expansion
Julian Gruber
>= 2.0.0, < 2.1.72.1.7
brace-expansion
Julian Gruber
>= 3.0.0, < 3.0.93.0.9
brace-expansion
Julian Gruber
>= 4.0.0, < 5.0.125.0.12
AttributeDetail
CWE IDCWE-400, CWE-407
Attack VectorNetwork (Remote)
CVSS v3.1 Score5.3
EPSS Score0.00301
ImpactAvailability (Denial of Service)
Exploit StatusProof-of-Concept
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1499.003Endpoint Denial of Service: Application Denial of Service
Impact
CWE-400
Uncontrolled Resource Consumption

The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, leading to exhaustion.

Vulnerability Timeline

Patches developed and committed by Julian Gruber
2026-09-14
GitHub Security Advisory GHSA-q2hr-2g5m-vwhr published
2026-09-28
CVE-2026-102277 assigned and published
2026-09-28
NVD database updated with analyzed metrics and CVSS vector details
2026-09-29

References & Sources

  • [1]GitHub Security Advisory (GHSA-q2hr-2g5m-vwhr)
  • [2]NVD Vulnerability Details Page
  • [3]CVE.org Record

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 2 hours ago•CVE-2026-9639
6.5

CVE-2026-9639: Authenticated Denial of Service via Nil-Pointer Dereference in Canonical LXD Custom Volume Backup Import

CVE-2026-9639 (GHSA-j93m-3j9p-m5m8) is a null pointer dereference vulnerability in Canonical LXD affecting versions 5.0.0 through 5.21.4 and 6.0 through 6.8. The flaw resides in the (*lxdBackend).CreateCustomVolumeFromBackup method within lxd/storage/backend_lxd.go. An authenticated attacker with the can_create_storage_volumes permission can upload a crafted custom volume backup tarball that omits the expires_at field on a snapshot entry, triggering an unhandled SIGSEGV panic and terminating the LXD daemon.

Amit Schendel
Amit Schendel
5 views•9 min read
•about 3 hours ago•CVE-2026-33050
8.8

CVE-2026-33050: OS Command Injection in GeoNode Vector Upload Handler

An operating system command injection vulnerability (CWE-78) exists in GeoNode versions prior to 5.1.0. The vulnerability occurs in the vector upload processing pipeline when handling user-supplied geospatial files. By supplying a crafted layer name containing shell metacharacters, an authenticated attacker with basic data upload privileges can execute arbitrary commands on the underlying server or container hosting the GeoNode application and Celery worker processes.

Alon Barad
Alon Barad
5 views•9 min read
•about 4 hours ago•CVE-2026-46429
5.5

CVE-2026-46429: Unrestricted File Upload and Validation Bypass in GeoNode

GeoNode versions prior to 5.0.3 contain an unrestricted file upload vulnerability (CWE-434) within the document and dataset ingestion architecture. Authenticated low-privileged users can bypass upload validation via direct REST API interactions, file extension masquerading, metadata mutation via PATCH requests, or malicious archive submissions. This allows attackers to store and serve dangerous file types, alter on-disk file references, or trigger path traversal and resource exhaustion during archive extraction.

Amit Schendel
Amit Schendel
5 views•10 min read
•about 5 hours ago•CVE-2026-55649
6.3

CVE-2026-55649: Stored Cross-Site Scripting in GeoNode Document Metadata Abstract Field

CVE-2026-55649 is a stored Cross-Site Scripting (XSS) vulnerability in GeoNode versions prior to 5.0.3. The flaw exists because document abstract metadata fields are ingested via the metadata management pipeline and stored in the backend database without HTML sanitization or input neutralization. An authenticated attacker with privileges to create or edit document metadata can inject arbitrary HTML and JavaScript payloads into these fields. When another user, such as an administrator, views the affected document page or catalog listing, the unencoded payload is rendered into the Document Object Model (DOM) and executes within the victim's browser session.

Amit Schendel
Amit Schendel
7 views•9 min read
•about 6 hours ago•GHSA-QX75-2P3R-PWM5
7.7

CVE-2026-55622: Cross-Project Instance Copy Authorization Bypass in Canonical LXD and LXC Incus

CVE-2026-55622 (GHSA-qx75-2p3r-pwm5) is an improper access control vulnerability (CWE-284) in Canonical LXD and LXC Incus (tracked as GHSA-c9f5-j9c3-mhrg). In multi-tenant deployments utilizing project-based isolation, the REST API handler for instance creation via POST /1.0/instances verifies that the authenticated user has authorization in the destination project specified by the query parameter, but fails to verify whether the user holds read or view permissions for the source instance when executing a copy operation across projects. Consequently, an authenticated client restricted to a single project can clone instances or snapshots from unauthorized projects into their own project, resulting in complete disclosure of the target instance filesystem and embedded credentials.

Amit Schendel
Amit Schendel
6 views•11 min read
•about 7 hours ago•GHSA-7MR3-28H5-M5VX
7.7

GHSA-7mr3-28h5-m5vx: Authorization Bypass and Cross-Project Volume Copy in Canonical LXD

An authorization bypass vulnerability in Canonical LXD (tracked as GHSA-7mr3-28h5-m5vx and CVE-2026-55621, and as GHSA-64f3-v33m-w89f in Linux Containers Incus) allows an authenticated user with restricted project access to copy custom storage volumes and volume snapshots from unauthorized projects. The flaw resides in the storagePoolVolumesPost REST API handler, which verifies permissions on the destination project but fails to check whether the caller holds view entitlements on the source project or volume specified in the request body.

Alon Barad
Alon Barad
5 views•10 min read