CVE-2025-32388Medium· 5.4▾ Sunlit@sveltejs/kit vulnerable to Cross-site Scripting via tracked search_params
▾ Sunlit zone — Low / medium · no exploitation signal
impact 29.7 · likelihood 0.1 · exploitation 0
Need a working PoC? Pro members can cast a request and our team develops one — it lands right here.
Exploit-prediction probability, daily snapshots since Oct 18.
Disclosure to exploitation, from the record and what we observed since indexing it.
Disclosed via GHSA
Last analysed / modified upstream
0.3%
Unsanitized search param names cause XSS vulnerability. You are affected if you iterate over all entries of event.url.searchParams inside a server load function. Attackers can exploit it by crafting a malicious URL and getting a user to click a link with said URL.
SvelteKit tracks which parameters in event.url.searchParams are read inside server load functions. If the application iterates over the these parameters, the uses.search_params array included in the boot script (embedded in the server-rendered HTML) will have any search param name included in unsanitized form.
packages/kit/src/runtime/server/utils.js:150 has the stringify_uses(node) function which prints these out.
In a +page.server.js or +layout.server.js:
/** @type {import('@sveltejs/kit').Load} */
export function load(event) {
const values = {};
for (const key of event.url.searchParams.keys()) {
values[key] = event.url.searchParams.get(key);
}
}
If a user visits the page in question via a link containing ?</script/><script>window.pwned%3D1</script/>, the </script> will be included verbatim in the payload, causing the embedded script to be executed.
It is not necessary to return the parameter value from load or render it in the page, only to read it (which causes it to be tracked as a dependency) while load is running.
Any application that iterates over all values in event.url.searchParams in a load function in +page.server.js or +layout.server.js (directly or indirectly) is vulnerable to XSS.
@sveltejs/kit >= 2.0.0, < 2.20.6Upgrade to a patched release:
@sveltejs/kit 2.20.6Connected by shared product, vendor, weakness, or advisory.
CVE-2024-53262Low· 4.2@sveltejs/kit has unescaped error message included on error page
CVE-2023-29003High· 8.8SvelteKit vulnerable to Cross-Site Request Forgery
CVE-2024-23641High· 7.5Sending a GET or HEAD request with a body crashes SvelteKit
CVE-2023-29008High· 8.8SvelteKit framework has Insufficient CSRF protection for CORS requests
CVE-2026-66062Medium· 5.3SvelteKit is a framework for rapidly developing robust, performant web applications using Svelte
GHSA-wqjv-9729-c5q2Medium· 5.3SvelteKit: Big remote form function payloads can cause Node process to crash