CVE-2024-53262 Unescaped error message included on error page in SvelteKit

Low 2.0 Published Updated

Attackers can inject scripts via unescaped error messages in SvelteKit applications that explicitly use user input in error objects.

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-53262?

CVE-2024-53262 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. The static error.html template for errors contains placeholders that are replaced without escaping the content first. error.html is the page that is rendered when everything else fails. It can contain the following placeholders: %sveltekit.status% — the HTTP status, and %sveltekit.error.message% — the error message. This leads to possible injection if an app explicitly creates an error with a message that contains user controlled content. Only applications where user provided input is used in the `Error` message will be vulnerable, so the vast majority of applications will not be vulnerable This issue has been addressed in version 2.8.3 and all users are advised to upgrade. There are no known workarounds for this vulnerability.

Weakness: CWE-79

Which versions are affected by CVE-2024-53262?

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-53262?

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-53262 being exploited?

There is no known exploitation of CVE-2024-53262 in the wild and no public exploit code.

Sources

Also known as GHSA-mh2x-fcqh-fmqv.

Is CVE-2024-53262 in your software?

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

Check your SBOMs for free