Apr 10, 2026·5 min read·111 visits
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.
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.
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.
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
}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);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.
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.
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| Product | Affected Versions | Fixed Version |
|---|---|---|
@sveltejs/kit Svelte | < 2.57.1 | 2.57.1 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-770 |
| Attack Vector | Network |
| CVSS v4.0 Score | 8.2 (High) |
| Impact | Denial of Service |
| Exploit Status | PoC Available |
| Affected Component | @sveltejs/adapter-node |
| Remediation | Upgrade to 2.57.1 |
The software allocates a resource without imposing a maximum limit on the amount that can be allocated.
An uncontrolled resource consumption vulnerability exists in the Docling document conversion library. Maliciously structured HTML, JATS, ODS, or BoxNote inputs containing table cells with excessively large 'rowspan' or 'colspan' attribute values trigger algorithmic complexity conditions. This allows unauthenticated remote attackers to initiate resource exhaustion states, crashing or hanging the target document processing pipeline while bypassing configured timeouts.
A Local File Inclusion (LFI) and Arbitrary File Disclosure vulnerability exists in Docling and Docling Slim versions >= 2.16.0 up to 2.131.0. When parsing serialized DoclingDocument structures using the JSON input format, the backend fails to restrict image URI schemes, allowing remote attackers to retrieve local files and verify path existence on the host system during embedded document export.
Docling, a tool for parsing and processing diverse document formats, is vulnerable to arbitrary file read, arbitrary file write, and potential remote code execution (RCE) in versions 2.94.0 through 2.131.0. The vulnerability occurs when applications configure Docling to use the Tectonic engine for rendering TikZ diagrams into images. Because the compilation did not restrict hazardous TeX primitives or sandbox the environment, an attacker can supply crafted documents containing malicious TikZ definitions to access or modify local files and execute arbitrary commands under the privileges of the processing application.
An SSRF guard bypass vulnerability in the Docling document conversion engine allows unauthenticated attackers to bypass internal IP access controls. The vulnerability exists due to a DNS rebinding Time-of-Check Time-of-Use (TOCTOU) condition, URL authority parsing inconsistencies, and unvalidated network requests triggered during headless browser page rendering.
A technical analysis of CVE-2026-105742 (GHSA-p3fw-7699-7926), a sensitive information disclosure vulnerability in the Docling document processing library. Vulnerable versions of Docling indiscriminately forward custom HTTP headers, such as authentication tokens, to arbitrary third-party origins and during cross-origin redirects while fetching remote image assets from untrusted HTML and EPUB documents.
CVE-2026-106121 is a Denial of Service (DoS) vulnerability in the RabbitMQ Java Client library (amqp-client) affecting versions prior to 5.37.0. The vulnerability resides in the legacy, custom JSON-RPC parsing class com.rabbitmq.tools.json.JSONReader. When parsing malformed or truncated payloads ending within a quoted string or single-line comment, the parser's scanner enters an infinite loop. This occurs because the loop lacks an exit condition for the end-of-input sentinel character returned by the iterator, leading to either CPU exhaustion or a JVM crash from an OutOfMemoryError.