# 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.

- **Severity:** Low 2.0 (`CVSS:4.0/AV:N/AC:H/AT:P/PR:L/UI:A/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N`)
- **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:** Yes
- **Published:** 25 Nov 2024
- **Updated:** 25 Nov 2024
- **Also known as:** GHSA-rjjv-87mx-6x3h

## 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 (Improper Neutralization of Input During Web Page Generation)

## Which versions are affected by CVE-2024-53261?

2 open source packages ship an affected version, including @sveltejs/kit. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `@sveltejs/kit` | npm | All versions | 2.8.3 |
| `@sveltejs/kit` | npm | All versions | 2.8.3 |

Products: Svelte Sveltekit.

## How do I fix CVE-2024-53261?

Upgrade @sveltejs/kit to 2.8.3 or later.

## 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](https://insights.sbomify.com/CVE-2023-29008/): SvelteKit framework has Insufficient CSRF protection for CORS requests (high 8.8)
- [CVE-2023-29003](https://insights.sbomify.com/CVE-2023-29003/): SvelteKit has Insufficient Cross-Site Request Forgery Protection (high 8.8)
- [CVE-2026-82259](https://insights.sbomify.com/CVE-2026-82259/): SvelteKit 2.49.0 before 2.53.3 Denial of Service via form (high 8.7)
- [CVE-2026-82260](https://insights.sbomify.com/CVE-2026-82260/): SvelteKit before 2.52.2 Memory Exhaustion via Remote Form Deserialization (high 8.7)
- [CVE-2026-82261](https://insights.sbomify.com/CVE-2026-82261/): SvelteKit before 2.52.2 CPU Exhaustion via Remote Form Deserialization (high 8.7)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-53261 and fix it if it is affected.

What it is: 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.
Exploitation: There is no known exploitation of CVE-2024-53261 in the wild and no public exploit code.

Affected packages and fixed versions:
- @sveltejs/kit (npm): affected all versions; fixed in 2.8.3
- @sveltejs/kit (npm): affected all versions; fixed in 2.8.3

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-53261/ (Markdown: https://insights.sbomify.com/CVE-2024-53261/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-53261
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-53261
- OSV: https://osv.dev/vulnerability/CVE-2024-53261

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-53261/
Summaries are generated and may contain mistakes; the official description above is the record.
