SvelteKit Remote Functions: Death by Type Coercion
Vulnerability ID: GHSA-VRHM-GVG7-FPCF
CVSS Score: 7.5
Published: 2026-02-19
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.
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.
⚠️ Exploit Status: POC
Technical Details
- CWE: CWE-770 (Allocation of Resources Without Limits)
- Attack Vector: Network (POST Request)
- CVSS: 7.5 (High)
- Impact: Denial of Service (Memory Exhaustion)
- Affected Component: form-utils.js (deserialize_binary_form)
- Exploit Status: Proof of Concept Available
Affected Systems
- SvelteKit applications with remote functions enabled
- Node.js servers hosting vulnerable SvelteKit versions
-
@sveltejs/kit: >= 2.49.0, <= 2.52.1 (Fixed in:
2.52.2)
Code Analysis
Commit: f47c01b
fix: validate file offsets
const parsed_offsets = JSON.parse(text_decoder.decode(file_offsets_buffer));
if (!Array.isArray(parsed_offsets) || parsed_offsets.some((n) => typeof n !== 'number' ...)) throw ...
Exploit Details
- SvelteKit Regression Test: Official test case demonstrating the malicious nested array structure.
Mitigation Strategies
- Disable experimental remote functions if not required.
- Implement WAF rules to inspect
application/x-svelte-binary-formpayloads for nested JSON arrays. - Deploy process monitoring to auto-restart Node.js services upon OOM crashes.
Remediation Steps:
- Check your
package.jsonfor@sveltejs/kit. - Run
npm install @sveltejs/kit@2.52.2oryarn upgrade @sveltejs/kit. - Verify the version with
npm list @sveltejs/kit. - Restart the application server.
References
Read the full report for GHSA-VRHM-GVG7-FPCF on our website for more details including interactive diagrams and full exploit analysis.
Top comments (0)