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

CVE-2026-40073: Unrestricted Resource Allocation in SvelteKit adapter-node via Chunked Transfer Encoding

Alon Barad
Alon Barad
Software Engineer

Apr 10, 2026·5 min read·19 visits

Executive Summary (TL;DR)

A flaw in SvelteKit allows attackers to bypass BODY_SIZE_LIMIT via chunked transfer encoding, resulting in uncontrolled memory allocation and Denial of Service.

SvelteKit's adapter-node fails to enforce the configured BODY_SIZE_LIMIT for incoming requests utilizing chunked transfer encoding. This logic error allows unauthenticated remote attackers to send arbitrarily large request bodies, bypassing internal framework protections and leading to memory exhaustion and server denial of service.

Vulnerability Overview

SvelteKit utilizes @sveltejs/adapter-node to generate standalone Node.js servers for deploying server-side rendered applications. The framework enforces a BODY_SIZE_LIMIT (defaulting to 512 kilobytes) to prevent excessively large payloads from exhausting server resources during request processing.

A logic vulnerability exists in how the framework parses specific HTTP requests, neutralizing this safeguard. When an incoming request uses chunked transfer encoding, the underlying body parser fails to accurately account for the accumulating payload size against the configured limit.

This bypass allows unauthenticated remote attackers to stream continuous data to the target endpoint. Because the application logic does not terminate the connection when the payload exceeds the limit, the server buffers the entirety of the malicious payload into memory, causing resource exhaustion.

Root Cause Analysis

The vulnerability originates in the get_raw_body function within packages/kit/src/exports/node/index.js. The original implementation relied on the Content-Length HTTP header to determine if an incoming request exceeded the BODY_SIZE_LIMIT parameter.

When an HTTP client uses Transfer-Encoding: chunked, the Content-Length header is omitted by protocol design. The get_raw_body function incorrectly assumed the content_length variable would resolve to a finite numeric value. Instead, the absence of the header caused the parser to assign the variable a value of NaN (Not-a-Number).

The enforcement routine evaluated the accumulated chunk size against the parsed limit using the conditional size > content_length. In the JavaScript specification, any numerical comparison involving NaN strictly evaluates to false. Consequently, the application accepted subsequent data chunks indefinitely, entirely skipping the rejection logic.

Code Analysis

The vulnerable implementation coupled the cumulative size check directly to the protocol-provided Content-Length header. The evaluation failed silently due to type coercion anomalies inherent to JavaScript.

// Vulnerable Logic in get_raw_body
size += chunk.length;
if (size > content_length) {
    // condition evaluates to false when content_length is NaN
    // memory buffer continues to grow without restriction
}

The patch implemented in commit 3202ed6c98f9e8d86bf0c4c7ad0f2e273e5e3b95 introduces a decoupled evaluation sequence. The system now validates the absolute size of the accumulated payload against the configured internal limit independently of the client-supplied HTTP headers.

// Patched Logic in get_raw_body
size += chunk.length;
 
// Primary check against configured application limit
if (body_size_limit !== undefined && size > body_size_limit) {
    cancelled = true;
    const message = `request body size exceeded BODY_SIZE_LIMIT of ${body_size_limit}`;
    const error = new SvelteKitError(413, 'Payload Too Large', message);
    controller.error(error);
    return;
}
 
// Secondary check for HTTP protocol consistency
if (has_content_length && size > content_length) {
    cancelled = true;
    // Reject requests that violate their own declared Content-Length
}

Exploitation Methodology

An attacker initiates the exploit by opening a persistent HTTP connection to a SvelteKit application utilizing adapter-node. The client sends a POST or PUT request with the Transfer-Encoding: chunked header while deliberately omitting the Content-Length header.

The client subsequently streams data blocks to the server. The attacker does not need to send the final zero-length chunk that typically terminates a chunked sequence. Instead, they supply an ongoing sequence of data blocks that rapidly consume the target application's memory pool.

import http from 'node:http';
 
const req = http.request({
  hostname: 'target.example.com',
  port: 443,
  method: 'POST',
  headers: { 'Transfer-Encoding': 'chunked' }
});
 
// Loop to exhaust server memory
setInterval(() => {
  req.write(Buffer.alloc(1024 * 1024, 'A')); 
}, 10);

Impact Assessment

Successful exploitation induces rapid resource exhaustion within the Node.js runtime environment. Because the framework allocates unconstrained memory buffers for incoming data, the application memory footprint grows proportionally to the attacker's transmission rate.

Once the memory usage exceeds the maximum heap size allocated to the V8 JavaScript engine, the process terminates with an Out-Of-Memory (OOM) exception. This event drops all concurrent connections and terminates the application service. If the process is not managed by an automated supervisor, the outage remains persistent.

The vulnerability carries a CVSS v4.0 base score of 8.2 (High). The metric evaluates the attack requirements as present, given the target must utilize adapter-node without external WAF-level payload restrictions. The primary impact maps exclusively to systemic availability.

Mitigation and Remediation

Software engineers must update the @sveltejs/kit dependency to version 2.57.1 or later. Applying this update introduces the decoupled limit verification logic and restores internal protection against anomalous payload sizes.

Organizations should implement defense-in-depth principles by configuring absolute payload limits at the perimeter infrastructure. Administrators must configure reverse proxies, such as Nginx or HAProxy, to enforce connection-level constraints utilizing directives like client_max_body_size.

In environments where immediate patching is unfeasible, operators can mitigate the attack surface by deploying network rules that block unauthenticated requests presenting the Transfer-Encoding: chunked header, provided legitimate client applications do not rely on chunked uploads.

Official Patches

SvelteKitOfficial GitHub Security Advisory
SvelteKitRelease Tag for 2.57.1

Fix Analysis (1)

Technical Appendix

CVSS Score
8.2/ 10
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Affected Systems

SvelteKit frameworkNode.js server applications utilizing @sveltejs/adapter-node

Affected Versions Detail

Product
Affected Versions
Fixed Version
@sveltejs/kit
Svelte
< 2.57.12.57.1
AttributeDetail
CWE IDCWE-770
Attack VectorNetwork
CVSS v4.0 Score8.2 (High)
ImpactDenial of Service
Exploit StatusPoC Available
Affected Component@sveltejs/adapter-node
RemediationUpgrade to 2.57.1

MITRE ATT&CK Mapping

T1499Endpoint Denial of Service
Impact
CWE-770
Allocation of Resources Without Limits or Throttling

The software allocates a resource without imposing a maximum limit on the amount that can be allocated.

Known Exploits & Detection

Internal Test SuiteProof of concept demonstrating bypass of BODY_SIZE_LIMIT via continuous Node.js HTTP request chunks.

Vulnerability Timeline

Initial vulnerability discovery and internal report.
2026-04-08
Fix committed to the sveltejs/kit repository.
2026-04-09
Security advisory published and CVE-2026-40073 assigned.
2026-04-10
Release of @sveltejs/kit version 2.57.1.
2026-04-10

References & Sources

  • [1]GHSA-2crg-3p73-43xp Advisory
  • [2]SvelteKit Mitigation Patch
  • [3]Official CVE 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

•1 day ago•CVE-2026-9354
6.9

CVE-2026-9354: Arbitrary Mass Mention Bypass in NousResearch hermes-agent Slack and Mattermost Adapters

A vulnerability in the Slack and Mattermost platform adapters for NousResearch hermes-agent permits an unauthenticated remote attacker to execute arbitrary mass mentions. By leveraging prompt injection, an attacker can bypass output sanitization logic and trigger workspace-wide notification exhaustion.

Alon Barad
Alon Barad
22 views•6 min read
•1 day ago•CVE-2026-9306
6.3

CVE-2026-9306: Unauthenticated Insecure Direct Object Reference (IDOR) in QuantumNous new-api Midjourney Relay

CVE-2026-9306 is a critical unauthenticated Insecure Direct Object Reference (IDOR) vulnerability located in the QuantumNous new-api application, affecting versions up to and including 0.12.1. The flaw is caused by improper middleware ordering combined with a lack of object-level authorization checks. This allows remote, unauthenticated attackers to retrieve sensitive Midjourney images belonging to other users by supplying a valid task identifier.

Amit Schendel
Amit Schendel
7 views•5 min read
•2 days ago•GHSA-GGXF-37HM-9WQF
6.5

GHSA-GGXF-37HM-9WQF: Session Leakage via Unsafe Challenge Path Parsing in instagrapi

The instagrapi library prior to version 2.6.9 contains an improper input validation vulnerability within its challenge handling mechanism. Maliciously crafted server responses can manipulate the client into forwarding session cookies and credentials to an external attacker-controlled domain.

Amit Schendel
Amit Schendel
19 views•6 min read
•3 days ago•GHSA-QQQM-5547-774X
9.1

GHSA-QQQM-5547-774X: Unauthenticated Path Traversal in FileBrowser Quantum PATCH Handler

GHSA-QQQM-5547-774X is a critical path traversal vulnerability in the FileBrowser Quantum application, specifically within the Go backend package. The vulnerability resides in the HTTP handler responsible for processing bulk file modifications via the public API. Unauthenticated attackers can exploit an order-of-operations flaw in the path sanitization logic to bypass intended directory restrictions. This allows adversaries to arbitrarily read, move, and overwrite files on the underlying filesystem by supplying specially crafted HTTP PATCH requests.

Alon Barad
Alon Barad
4 views•6 min read
•3 days ago•CVE-2026-8723
5.3

CVE-2026-8723: Synchronous Denial of Service in qs npm Package via TypeError

The qs query string parsing and serialization library for Node.js is vulnerable to a synchronous Denial of Service (DoS) attack. The vulnerability manifests as a process-terminating TypeError when processing arrays with null or undefined elements under specific configuration parameters.

Amit Schendel
Amit Schendel
32 views•7 min read
•3 days ago•GHSA-7M8F-HGJQ-8GC9
7.5

GHSA-7M8F-HGJQ-8GC9: Pre-Authentication Denial of Service via Insecure Deserialization Order in aiosend

The aiosend library prior to version 3.0.6 contains a pre-authentication Denial of Service (DoS) vulnerability in its webhook handling mechanism. The software processes and deserializes incoming JSON payloads before verifying the cryptographic signature, allowing unauthenticated attackers to exhaust server CPU and memory resources by sending large, complex payloads.

Amit Schendel
Amit Schendel
3 views•6 min read