CVE-2024-53261 Cross-Site Scripting attack (XSS) on dev mode 404 page in SvelteKit
An XSS vulnerability in SvelteKit's dev mode 404 page allows attackers to execute scripts if the dev server is exposed, though impact is low.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2024-53261?
CVE-2024-53261 is a low-severity cross-site scripting vulnerability in sveltejs kit, published on 25 Nov 2024. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.
Official description
SvelteKit is a framework for rapidly developing robust, performant web applications using Svelte. "Unsanitized input from *the request URL* flows into `end`, where it is used to render an HTML page returned to the user. This may result in a Cross-Site Scripting attack (XSS)." The files `packages/kit/src/exports/vite/dev/index.js` and `packages/kit/src/exports/vite/utils.js` both contain user controllable data which under specific conditions may flow to dev mode pages. There is little to no expected impact. The Vite development is not exposed to the network by default and even if someone were able to trick a developer into executing an XSS against themselves, a development database should not have any sensitive data. None the less this issue has been addressed in version 2.8.3 and all users are advised to upgrade.
Weakness: CWE-79
Which versions are affected by CVE-2024-53261?
2 open source packages ship an affected version, including @sveltejs/kit. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
@sveltejs/kit npm | All versions | 2.8.3 |
@sveltejs/kit npm | All versions | 2.8.3 |
Products include Svelte Sveltekit.
How do I fix CVE-2024-53261?
Upgrade @sveltejs/kit to 2.8.3 or later.
Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.
Is CVE-2024-53261 being exploited?
There is no known exploitation of CVE-2024-53261 in the wild and no public exploit code.
Other vulnerabilities in sveltejs kit
- CVE-2023-29008 SvelteKit framework has Insufficient CSRF protection for CORS requests
- CVE-2023-29003 SvelteKit has Insufficient Cross-Site Request Forgery Protection
- CVE-2026-82259 SvelteKit 2.49.0 before 2.53.3 Denial of Service via form
- CVE-2026-82260 SvelteKit before 2.52.2 Memory Exhaustion via Remote Form Deserialization
- CVE-2026-82261 SvelteKit before 2.52.2 CPU Exhaustion via Remote Form Deserialization
Sources
Also known as GHSA-rjjv-87mx-6x3h.