CVE-2024-53261: @sveltejs/kit Cross-Site Scripting Vulnerability
LOWCVE-2024-53261 is a LOW (CVSS 0.0) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting @sveltejs/kit libraries in the npm ecosystem. The issue involves @sveltejs/kit vulnerable to xss on dev mode 404 page. Remediation is available by upgrading affected packages to version 2.8.3.
CVE-2024-53261 at a Glance
Security Impact
CVSS: 0.0
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:A/AC:L/PR:N/UI:R/S:C/C:N/I:N/A:N).
How to Fix CVE-2024-53261
To remediate this vulnerability, upgrade all affected @sveltejs/kit dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install @sveltejs/kit@2.8.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @sveltejs/kit
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2024-53261, inspect your project dependencies using npm:
npm ls @sveltejs/kit
Analyze the terminal output to locate any version of @sveltejs/kit in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.8.3), your application is affected.
Note: The npm ls @sveltejs/kit command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In @sveltejs/kit, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-53261 Affected @sveltejs/kit Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@sveltejs/kit
|
npm |
< 2.8.3
|
2.8.3
|
References
Frequently Asked Questions
What is CVE-2024-53261?
Which @sveltejs/kit versions are affected?
What version fixes CVE-2024-53261?
Is @sveltejs/kit affected?
What is the CVSS score of CVE-2024-53261?
What CWE is associated with CVE-2024-53261?
How can I check npm dependencies for CVE-2024-53261?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-rjjv-87mx-6x3h",
"modified" : "2025-01-22T20:54:21Z",
"published" : "2024-11-25T15:33:19Z",
"aliases" : [ "CVE-2024-53261" ],
"summary" : "@sveltejs/kit vulnerable to XSS on dev mode 404 page",
"details" : "### Summary\n\n\"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).\"\n\n### Details\n\nSource of potentially tainted data is in `packages/kit/src/exports/vite/dev/index.js`, line 437. This potentially tainted data is passed through a number of steps (which I could detail if you'd like) all the way down to line 91 in `packages/kit/src/exports/vite/utils.js`, which performs an operation that Snyk believes an attacker shouldn't be allowed to manipulate.\n\nAnother source of potentially tainted data (according to Snyk) comes from `packages/kit/src/exports/vite/utils.js`, line 30, col 30 (i.e., the `url` property of `req`). This potentially tainted data is passed through a number of steps (which I could detail if you'd like) all the way down line 91 in `packages/kit/src/exports/vite/utils.js`, which performs an operation that Snyk believes an attacker shouldn't be allowed to manipulate.\n\n### PoC\n\nNot provided\n\n### Impact\n\nLittle to none. 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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:A/AC:L/PR:N/UI:R/S:C/C:N/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@sveltejs/kit"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.8.3"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/sveltejs/kit/security/advisories/GHSA-rjjv-87mx-6x3h"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-53261"
}, {
"type" : "WEB",
"url" : "https://github.com/sveltejs/kit/pull/13039"
}, {
"type" : "WEB",
"url" : "https://github.com/sveltejs/kit/commit/d338d4635a7fd947ba5112df6ee632c4a0979438"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/sveltejs/kit"
}, {
"type" : "WEB",
"url" : "https://github.com/sveltejs/kit/releases/tag/%40sveltejs%2Fkit%402.8.3"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2024-11-25T15:33:19Z",
"nvd_published_at" : "2024-11-25T20:15:10Z"
}
}