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

CVE-2026-66062: Regular Expression Denial of Service (ReDoS) in SvelteKit Content Negotiation

Alon Barad
Alon Barad
Software Engineer

Aug 8, 2026·6 min read·2 visits

Executive Summary (TL;DR)

SvelteKit versions before 2.70.2 are vulnerable to a CPU-exhausting ReDoS via malformed Accept headers due to an unanchored regular expression in its content negotiation parser.

A Regular Expression Denial of Service (ReDoS) vulnerability exists in SvelteKit's content negotiation header parser prior to version 2.70.2. An unauthenticated remote attacker can exploit this vulnerability by sending a crafted Accept header with highly repetitive malformed values. This triggers catastrophic backtracking on the single-threaded Node.js/Bun event loop, leading to CPU exhaustion and full denial of service.

Vulnerability Overview

SvelteKit utilizes a content negotiation system to determine how to format and serve responses to clients. This mechanism, residing in packages/kit/src/utils/http.js, inspects incoming HTTP request headers—specifically the Accept header—to identify the appropriate MIME types requested by the client.

Because content negotiation occurs globally early in the middleware request lifecycle, the parsing path is exposed to all incoming network requests. This introduces an unauthenticated attack surface that does not require any session establishment, specific API privileges, or application-specific configurations.

The parsing logic relies on a regular expression designed to break down comma-separated MIME types and extract quality values (such as q=0.9). However, due to an unanchored configuration within this pattern (CWE-1333), the parser is susceptible to a catastrophic backtracking loop when presented with a specially crafted string. An attacker can exploit this behavior to force high CPU utilization, exhausting server-side compute resources.

Root Cause Analysis

The root cause of this vulnerability lies in the unanchored nature of SvelteKit's MIME-type parsing regular expression:

/([^/ \\t]+)\\/([^; \\t]+)[ \\t]*(?:;[ \\t]*q=([0-9.]+))?/

When evaluating a regular expression, engines typically attempt to find a match starting at the first character of the string. If a match attempt fails, and the regular expression does not contain a start anchor (such as ^), the engine advances the starting pointer to the next character in the string and restarts the entire matching routine.

Consider an input string of length $N$ consisting entirely of the character 'a' without any forward slash / (e.g., "aaaa...aaa"). The engine begins matching at index 0, where the greedy group ([^/ \\t]+) matches the entire sequence of $N$ characters. The engine then attempts to match the literal slash \\/ character, which is missing from the input. This mismatch triggers back-tracking, forcing the engine to test smaller subsets of the greedy group.

Once all backtracking paths at index 0 fail, the unanchored engine shifts its starting window to index 1 and repeats the process. It continues this behavior for every index up to $N$. This results in a quadratic execution complexity of $O(N^2)$, executing roughly $\frac{N \times (N+1)}{2}$ steps. In a single-threaded execution model like Node.js or Bun, this computationally intensive loop completely blocks the main event loop.

Code Analysis

The vulnerable logic is found within the negotiate function inside packages/kit/src/utils/http.js. The function splits the Accept header on commas and processes each segment:

// Vulnerable Code Path
export function negotiate(accept, types) {
	const parts = [];
 
	accept.split(',').forEach((str, i) => {
		// Unanchored regex allows the engine to retry matching at every character offset
		const match = /([^/ \\t]+)\\/([^; \\t]+)[ \\t]*(?:;[ \\t]*q=([0-9.]+))?/.exec(str);
 
		if (match) {
			// processing matches...
		}
	});
}

The fix, introduced in commit 82712fc02c24b1dcf5b25d7a52129cd8455f04f5, prepends the start-of-line anchor ^[ \\t]* to lock the evaluation to the very beginning of each segment:

// Patched Code Path
export function negotiate(accept, types) {
	const parts = [];
 
	accept.split(',').forEach((str, i) => {
		// Prepending the ^ anchor limits attempts strictly to the beginning of the string
		const match = /^[ \\t]*([^/ \\t]+)\\/([^; \\t]+)[ \\t]*(?:;[ \\t]*q=([0-9.]+))?/.exec(str);
 
		if (match) {
			// processing matches...
		}
	});
}

By forcing the regular expression to match only from the start of the string, the engine is prevented from shifting its evaluation window. If the match fails at index 0, the evaluation is immediately aborted. This restricts the execution complexity to a safe, linear $O(N)$ runtime.

Exploitation Methodology

Exploitation of this vulnerability is straightforward and requires only a single, malformed HTTP request. An attacker targets any SvelteKit endpoint with a custom Accept header containing a highly repetitive pattern of alphanumeric characters containing no slash.

An example of a conceptual payload sent via HTTP:

GET / HTTP/1.1
Host: vulnerable-app.internal
Accept: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Connection: close

Because many standard web servers and reverse proxies enforce an 8 KB limit on request headers, the size of a single header segment is physically constrained. However, even an 8,000-character payload forces millions of evaluations inside the regular expression engine. Multiple concurrent requests containing this payload will quickly saturate all available CPU threads allocated to the Node.js application process.

Impact Assessment

The impact of this vulnerability is a complete loss of service availability. While confidential data exposure and unauthorized write actions are not possible (resulting in a CVSS vector of C:N/I:N/A:L or A:H depending on deployment topology), the blocking of the single-threaded Node.js or Bun event loop ensures that no other network requests can be processed.

In containerized or auto-scaling environments (such as AWS ECS, Kubernetes, or serverless platforms), the CPU exhaustion will trigger horizontal scaling, potentially resulting in inflated operational costs. In single-instance node architectures, this attack will permanently freeze the web server until the process is manually restarted or killed by a health check timeout.

Remediation and Testing

The recommended remediation is upgrading @sveltejs/kit to version 2.70.2 or later. This replaces the vulnerable regular expression engine configuration with the anchored version.

If immediate software upgrade is not possible, implement the following mitigations:

  1. Enforce strict HTTP header limits at the reverse proxy (e.g., NGINX, Cloudflare, AWS ALB) to drop any Accept headers longer than 1024 bytes.
  2. Implement a WAF rule to drop requests where the Accept header contains long contiguous sequences of letters without a / character.

SvelteKit developers integrated the following regression test inside packages/kit/src/utils/http.spec.js to ensure backtracking issues do not reappear:

test('ignores an accept segment with no slash without catastrophic backtracking', () => {
	assert.equal(negotiate('a'.repeat(200_000), ['text/html']), undefined);
}, 100);

This test suite fails if the execution of negotiate on a 200,000-character string takes longer than the strict 100ms timeout threshold.

Official Patches

SvelteSvelteKit Release 2.70.2

Fix Analysis (1)

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

Affected Systems

SvelteKit Server ApplicationsNode.js execution environments running @sveltejs/kitBun execution environments running @sveltejs/kit

Affected Versions Detail

Product
Affected Versions
Fixed Version
@sveltejs/kit
Svelte
< 2.70.22.70.2
AttributeDetail
CWE IDCWE-1333 (Inefficient Regular Expression Complexity)
Attack VectorNetwork (AV:N)
CVSS5.3 (Medium)
EPSSN/A
ImpactDenial of Service (DoS)
Exploit StatusPoC Available
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1499.004Endpoint Denial of Service: Application Exhaustion Flood
Denial of Service
CWE-1333
Inefficient Regular Expression Complexity

The software uses a regular expression that can take a very long time to evaluate on certain inputs, leading to a Denial of Service.

References & Sources

  • [1]GitHub Security Advisory GHSA-29g2-3rmr-qm68
  • [2]SvelteKit Fix Commit 82712fc02c24b1dcf5b25d7a52129cd8455f04f5
  • [3]NVD Entry for CVE-2026-66062

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

•43 minutes ago•GHSA-7C4V-FWGW-9RF7
5.3

GHSA-7c4v-fwgw-9rf7: Nuxt Dev Server Discloses Project Root and Workspace UUID via Chrome DevTools Endpoint

An information disclosure vulnerability in the Nuxt development server allows adjacent network attackers to retrieve the absolute project root directory and a persistent workspace UUID by querying the unprotected Chrome DevTools workspace endpoint. This occurs when the development server is bound to a network-reachable interface, allowing requests that bypass the header-based security verification checks.

Alon Barad
Alon Barad
0 views•7 min read
•about 3 hours ago•CVE-2026-15895
8.4

CVE-2026-15895: OS Command Injection in AWS jsii-diff CLI

An OS command injection vulnerability exists in the npm package loading component of the jsii-diff CLI tool within the AWS jsii framework. Prior to version 1.131.0, when parsing package specifiers prefixed with `npm:`, the tool concatenated user-controlled inputs directly into a shell execution string via child_process.exec. This allows attackers to execute arbitrary shell commands under the context of the running Node.js process.

Amit Schendel
Amit Schendel
2 views•7 min read
•about 4 hours ago•CVE-2026-63220
4.8

CVE-2026-63220: Trust of Untrusted Reverse Proxy Headers in CodeIgniter4

CodeIgniter4 versions prior to v4.7.4 contain a protocol-spoofing vulnerability due to improper verification of upstream reverse proxy forwarding headers. Remote, unauthenticated attackers can inject headers like X-Forwarded-Proto to deceive the framework into identifying an insecure HTTP request as a secure HTTPS connection.

Alon Barad
Alon Barad
4 views•7 min read
•about 5 hours ago•CVE-2026-63221
9.4

CVE-2026-63221: SQL Injection in CodeIgniter4 Query Builder deleteBatch()

An SQL injection vulnerability exists in the Query Builder component of the CodeIgniter4 full-stack PHP framework. The vulnerability is located within the compilation logic of the batch delete operation, deleteBatch(). When an application chains where() conditions prior to calling deleteBatch(), the Query Builder fails to enforce or respect the escaping flags of the parameters bound to the WHERE clauses. Instead of passing these parameters through the database driver standard escaping logic, the compilation engine interpolates the raw, unescaped bound values directly into the compiled SQL string, allowing remote attackers to execute arbitrary SQL commands.

Amit Schendel
Amit Schendel
4 views•8 min read
•about 6 hours ago•CVE-2026-63222
7.5

CVE-2026-63222: Remote Code Execution via Path Traversal in CodeIgniter4 File Upload Handler

CVE-2026-63222 details a high-severity path traversal vulnerability in CodeIgniter4 versions prior to 4.7.4. The flaw lies within the `UploadedFile::move()` handler, which falls back to unsanitized, client-provided file names from the HTTP multipart request when a target name is not explicitly passed. An unauthenticated remote attacker can exploit this flaw to traverse arbitrary server directories, write malicious PHP payloads to the public-facing web root, and execute arbitrary code on the target system.

Amit Schendel
Amit Schendel
5 views•6 min read
•about 7 hours ago•CVE-2026-63223
9.8

CVE-2026-63223: Unrestricted File Upload leading to Remote Code Execution in CodeIgniter4

A critical unrestricted file upload vulnerability (CWE-434) in CodeIgniter4 allows unauthenticated remote attackers to execute arbitrary code. By bypassing weak validation filters in the `is_image` and `mime_in` rules, an attacker can upload a malicious PHP payload disguised as a valid image file.

Amit Schendel
Amit Schendel
4 views•6 min read