CVE-2024-53261 Cross-Site Scripting attack (XSS) on dev mode 404 page in SvelteKit

Low 2.0 Published Updated

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.

PackageAffectedFixed in
@sveltejs/kit npmAll versions2.8.3
@sveltejs/kit npmAll versions2.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.

Sources

Also known as GHSA-rjjv-87mx-6x3h.

Is CVE-2024-53261 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free