Junglewise Threat Intelligence

CVE-2024-53261: SvelteJS Kit cross-site scripting in dev mode 404 page

CVE-2024-53261 · Severity: low · CVSS 3.1 · Published 2024-11-25

Technologies: Svelte Kit, @sveltejs/kit (npm). Vendors: Svelte, npm.

Executive brief

SvelteJS Kit is a framework for building web applications. During development, the 404 error page fails to sanitize malicious input from the URL, allowing an attacker to inject JavaScript code that executes in a developer's browser. While the development server is not typically exposed to the network, an attacker could trick a developer into clicking a malicious link, potentially compromising their local development environment.

Technical details

This is a cross-site scripting (XSS) vulnerability in SvelteJS Kit's development mode. Unsanitized user input from the request URL flows into the 404 error page rendering logic in packages/kit/src/exports/vite/dev/index.js (line 437), propagates through packages/kit/src/exports/vite/utils.js (line 91), and is output in the HTML page without proper sanitization. The vulnerability requires user interaction (the developer must click a malicious link) and is restricted to the adjacent network attack vector. While the impact is low (development servers are not network-exposed by default, and dev databases lack sensitive data), an attacker could craft a malicious URL to execute arbitrary JavaScript in a developer's browser during development. The vulnerability is fixed in version 2.8.3 and later.

Affected products

  • SvelteJS Kit < 2.8.3

Timeline

  • 2024-11-25: disclosed
  • 2024-11-25: patched: Version 2.8.3 released

References

Related threats