CVE-2024-53262 Unescaped error message included on error page in SvelteKit
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.
| 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-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.
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-mh2x-fcqh-fmqv.