CVE-2025-32388: @sveltejs/kit vulnerable to Cross-site Scripting via tracked search_params

CVE-2025-32388 · Severity: medium · CVSS 5.4 · Published 2025-04-14

SvelteKit is a web framework used to build server-rendered web applications. When a SvelteKit application iterates over URL search parameters in a server load function, parameter names are embedded unsanitized in the HTML sent to users. An attacker can craft a malicious URL containing JavaScript code in a parameter name and trick users into clicking the link, allowing arbitrary code execution in the victim's browser.

Technologies: @sveltejs/kit (npm). Vendors: npm.

Quick answers

Is CVE-2025-32388 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2025-32388 being exploited in the wild.
How severe is CVE-2025-32388?
Medium severity, with a CVSS score of 5.4, published 14 April 2025.
Which products and versions are affected?
@sveltejs/kit (npm) >= 2.0.0, < 2.20.6, SEMVER:introduced=2.0.0,fixed=2.20.6.
Is there a fix for CVE-2025-32388?
Yes. @sveltejs/kit (npm): upgrade to 2.20.6 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2025-32388 attacked?
It is attacked over the network.
Am I affected by CVE-2025-32388?
Check whether you run @sveltejs/kit (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • @sveltejs/kit (npm): upgrade to 2.20.6 or later
    npm install @sveltejs/kit@2.20.6

Technical details

The vulnerability is a cross-site scripting (XSS) flaw in SvelteKit's search parameter tracking. When applications read search parameter keys/values inside server load functions (in +page.server.js or +layout.server.js), SvelteKit tracks these dependencies and embeds them in the boot script within the server-rendered HTML. The stringify_uses() function in packages/kit/src/runtime/server/utils.js does not sanitize parameter names before inclusion, allowing an attacker to inject malicious content. The attack requires user interaction (clicking a crafted link containing payload like `?</script><script>window.pwned=1</script>`) but requires no authentication or special privileges. An exploit executes arbitrary JavaScript in the victim's session context, potentially leading to session hijacking, credential theft, or data exfiltration. The fix is available in version 2.20.6 and later.

Affected products

  • Svelte @sveltejs/kit 2.0.0 to 2.20.5

Identifiers

  • CVE-2025-32388
  • GHSA-6q87-84jw-cjhp

Timeline

  • 2025-04-14: disclosed: Advisory published
  • 2025-04-14: patched: Fix released in version 2.20.6

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.