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



GHSA-VRHM-GVG7-FPCF

SvelteKit Remote Functions: Death by Type Coercion

Alon Barad
Alon Barad
Software Engineer

Feb 19, 2026·5 min read·25 visits

Executive Summary (TL;DR)

SvelteKit's experimental remote functions feature trusts user-supplied JSON for file offsets. Attackers can send nested arrays instead of numbers, triggering JavaScript type coercion that expands a 1MB payload into ~15GB of memory usage, crashing the server immediately.

A denial-of-service vulnerability in SvelteKit's experimental 'remote functions' feature allows attackers to crash the server via memory exhaustion. By manipulating a JSON-encoded 'file offset table' within a custom binary form payload, an attacker can trigger JavaScript type coercion that expands a small payload into gigabytes of string data, overwhelming the Node.js heap.

The Hook: Experimental Features are a Trap

In the world of web frameworks, 'experimental' is often just a polite synonym for 'un-audited.' SvelteKit, the darling of the modern frontend world, introduced a feature called remote functions to handle server-side logic invoked directly from the client. To make this efficient, they cooked up a custom content type: application/x-svelte-binary-form.

Whenever a developer sees a custom binary protocol being parsed by a high-level language like JavaScript, their ears should perk up. It means the framework is taking raw bytes and trying to turn them into structured objects. And as we all know, if you don't strictly validate what those bytes represent before you start casting them to types, you're asking for trouble.

This vulnerability is a classic case of trusting the input. The parser assumes it's getting a nice, orderly list of numbers. Instead, we're going to feed it a recursive nightmare.

The Flaw: Trusting the JSON Fairy

The vulnerability lives in src/runtime/form-utils.js, specifically within the deserialize_binary_form function. This function is responsible for unpacking that custom binary format. Part of this format includes a file offset table—essentially a map telling the server where file data begins and ends in the byte stream.

To parse this table, SvelteKit did something incredibly simple. Too simple:

// The vulnerable code
file_offsets = /** @type {Array<number>} */ (
  JSON.parse(text_decoder.decode(file_offsets_buffer))
);

See the problem? They run JSON.parse() and then immediately cast it to Array<number> via JSDoc comments. But JSDoc is a build-time lie; it doesn't exist at runtime. JSON.parse() will happily parse anything valid JSON—strings, objects, or, most critically, nested arrays.

The code assumes file_offsets is a flat array of integers. It does not check. It just blindly passes this data downstream to the logic that constructs file objects.

The Code: The Smoking Gun

Let's look at the diff. The fix is a textbook example of "oops, we forgot to check the types."

Before the fix, the code was cowboy-style:

file_offsets = JSON.parse(text_decoder.decode(file_offsets_buffer));

After the fix (Commit f47c01bd8100328c24fdb8522fe35913b0735f35), sanity is restored:

const parsed_offsets = JSON.parse(text_decoder.decode(file_offsets_buffer));
 
if (
  !Array.isArray(parsed_offsets) ||
  parsed_offsets.some((n) => typeof n !== 'number' || !Number.isInteger(n) || n < 0)
) {
  throw deserialize_error('invalid file offset table');
}
 
file_offsets = parsed_offsets;

The patch explicitly validates that:

  1. The result is actually an Array.
  2. Every single element is a number.
  3. Every number is an integer and non-negative.

Without this check, file_offsets could contain [[1e20, 1e20]], which is syntactically valid JSON but disastrous for the logic that follows.

The Exploit: Weaponizing Type Coercion

So, how do we turn a wrong type into a server crash? Welcome to the horrors of JavaScript type coercion.

When the SvelteKit runtime tries to use these "offsets" to initialize File or Blob objects, it inadvertently performs operations that trigger string conversion. If you pass a nested array (e.g., [1e20, 1e20]) into a context expecting a primitive, JavaScript often calls .toString() on it.

Here is the attack flow:

  1. Payload Construction: We create a binary form where the offset table is a JSON string of a nested array: [[1e20, 1e20, ...]]. We fill this inner array with massive numbers.
  2. The Trigger: We send this to an endpoint with remote functions enabled.
  3. The Boom: The server parses the JSON. When it tries to use the inner array as an offset (or part of a file descriptor), JS attempts to coerce it. Array.toString() joins elements with commas.

A relatively small payload (1MB) containing a dense array of these numbers converts into a string representation that is gigabytes in size. The Node.js heap, which usually defaults to a few GBs, fills up instantly.

> [!NOTE] > A 1MB payload was observed to spike memory usage to 14.7 GB before the process died. This is an amplification factor of roughly 14,000x.

The console will spit out Fatal error: Ineffective mark-compacts near heap limit Allocation failed, and the process dies. If you don't have an auto-restarter (or if the attacker puts this in a loop), your service is effectively dead.

The Fix: A Dash of Validation

The remediation is straightforward: Update to @sveltejs/kit 2.52.2.

If you cannot update immediately, you have two options:

  1. Disable Remote Functions: Since this feature is experimental anyway, verify if you are actually using it. If not, turn it off.
  2. WAF Filtering: You could theoretically inspect the body of application/x-svelte-binary-form requests. The JSON offset table is usually near the start of the body. If you see nested brackets [[ inside the JSON structure, drop the packet.

But seriously, just patch it. This is a logic error in the runtime, and no amount of firewall rules will be as effective as code that actually checks its inputs.

Official Patches

SvelteCommit fixing the vulnerability by enforcing type checks.

Fix Analysis (1)

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

Affected Systems

SvelteKit applications with remote functions enabledNode.js servers hosting vulnerable SvelteKit versions

Affected Versions Detail

Product
Affected Versions
Fixed Version
@sveltejs/kit
Svelte
>= 2.49.0, <= 2.52.12.52.2
AttributeDetail
CWECWE-770 (Allocation of Resources Without Limits)
Attack VectorNetwork (POST Request)
CVSS7.5 (High)
ImpactDenial of Service (Memory Exhaustion)
Affected Componentform-utils.js (deserialize_binary_form)
Exploit StatusProof of Concept Available

MITRE ATT&CK Mapping

T1499.003Endpoint Denial of Service: OS Resource Exhaustion
Impact
T1203Exploitation for Client Execution
Execution
CWE-770
Allocation of Resources Without Limits

Allocation of Resources Without Limits or Throttling

Known Exploits & Detection

SvelteKit Regression TestOfficial test case demonstrating the malicious nested array structure.

Vulnerability Timeline

Vulnerability identified and fixed in SvelteKit
2026-02-18
Version 2.52.2 released to npm
2026-02-18
GHSA advisory published
2026-02-18

References & Sources

  • [1]GitHub Advisory
  • [2]Pull Request Analysis

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 10 hours ago•GHSA-7PPR-R889-MCF2
7.5

GHSA-7PPR-R889-MCF2: Unbounded WebSocket Message Aggregation in http4s-blaze-server leads to Denial of Service

An uncontrolled resource consumption vulnerability exists in the Scala-based http4s-blaze-server package of the http4s/blaze library. The vulnerability allows remote, unauthenticated attackers to cause an Out of Memory Error (OOM) and JVM crash by streaming a continuous sequence of small or empty WebSocket continuation frames with the FIN bit set to 0. This bypasses typical payload size checks because of the JVM's per-object allocation overhead, leading to rapid heap exhaustion with minimal network bandwidth.

Alon Barad
Alon Barad
6 views•5 min read
•about 11 hours ago•GHSA-95CV-R8X4-VH75
7.6

GHSA-95cv-r8x4-vh75: Path Traversal Vulnerability in OpenList Batch Rename Handler

A critical path traversal vulnerability has been identified in the OpenList Go-based backend package. The vulnerability exists within the batch rename handler because the application does not validate the source filename parameter before constructing filesystems paths. This omission allows authenticated users to escape their designated directory and rename files in sibling paths.

Amit Schendel
Amit Schendel
7 views•7 min read
•about 12 hours ago•GHSA-P6PH-3JX2-3337
4.3

GHSA-P6PH-3JX2-3337: Horizontal Privilege Escalation and Metadata Information Disclosure via Bleve Search in OpenList

OpenList version 4.2.3 and prior is vulnerable to an authorization bypass and metadata leakage. When configured with the Bleve search engine backend, OpenList fails to perform separator-aware path matching when validating tenant containment. This allows authenticated users to access sibling directories sharing similar name prefixes. Furthermore, the search backend returns unfiltered global result counts, leaking existence verification data of unauthorized files via side-channel analysis.

Amit Schendel
Amit Schendel
7 views•5 min read
•about 13 hours ago•GHSA-86CX-WWF4-PHQ4
6.5

GHSA-86cx-wwf4-phq4: Path Prefix Confusion Authorization Bypass in OpenList

An authorization bypass vulnerability in OpenList version 4.2.3 and below allows authenticated users to read arbitrary files outside of their designated base directories due to an insecure path prefix check using Go's standard strings.HasPrefix function.

Amit Schendel
Amit Schendel
6 views•6 min read
•about 14 hours ago•CVE-2026-16584
7.0

CVE-2026-16584: Security Policy Bypass in AWS API MCP Server via Startup Initialization Failure

A security policy bypass vulnerability exists in the AWS API MCP Server (awslabs-aws-api-mcp-server) from version 0.2.13 through 1.3.46. When the server fails to load the read-only operations index during startup (due to transient network failures, file permission issues, or other exceptions), it logs a warning but continues running in an insecure, degraded state. Under this condition, the security policy engine fails open, silently skipping all subsequent security checks and consent prompts for the lifetime of the process. This permits unauthorized mutating AWS CLI commands to execute via indirect prompt injection attacks.

Amit Schendel
Amit Schendel
7 views•7 min read
•about 15 hours ago•GHSA-6V4M-FW66-8R4X
6.5

GHSA-6V4M-FW66-8R4X: Path Disclosure and Shell Expansion Bypass in Shescape

An incomplete escaping vulnerability in the npm package 'shescape' allows unauthenticated users to trigger dynamic shell expansions, absolute path disclosure, and command block break-outs on Unix and Windows systems.

Alon Barad
Alon Barad
6 views•7 min read