CVE-2024-53262: @sveltejs/kit @sveltejs/kit Has Unescaped Error Message Vulnerability
LOWCVE-2024-53262 is a LOW (CVSS 4.2) @sveltejs/kit has unescaped error message 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 has unescaped error message included on error page. Remediation is available by upgrading affected packages to version 2.8.3.
CVE-2024-53262 at a Glance
Security Impact
CVSS: 4.2
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:N).
How to Fix CVE-2024-53262
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-53262, 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-53262 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-53262?
Which @sveltejs/kit versions are affected?
What version fixes CVE-2024-53262?
Is @sveltejs/kit affected?
What is the CVSS score of CVE-2024-53262?
What CWE is associated with CVE-2024-53262?
How can I check npm dependencies for CVE-2024-53262?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-mh2x-fcqh-fmqv",
"modified" : "2024-11-25T21:46:57Z",
"published" : "2024-11-25T15:32:45Z",
"aliases" : [ "CVE-2024-53262" ],
"summary" : "@sveltejs/kit has unescaped error message included on error page",
"details" : "### Summary\n\nThe static error.html template for errors contains placeholders that are replaced without escaping the content first.\n\n### Details\n\nFrom https://kit.svelte.dev/docs/errors:\n\n> error.html is the page that is rendered when everything else fails. It can contain the following placeholders:\n%sveltekit.status% — the HTTP status\n%sveltekit.error.message% — the error message\n\nThis leads to possible injection if an app explicitly creates an error with a message that contains user controlled content that ends up being something like this inside a server handle function: \n```js\nerror(500, '<script>alert(\"boom\")</script>');\n```\nUncaught errors cannot be exploited like this, as they always render the message \"Internal error\".\n\nEscaping the message string in the function that creates the html output can be done to improve safety for applications that are using custom errors on the server.\n\n### PoC\n\nNone provided\n\n### Impact\n\nOnly applications where user provided input is used in the `Error` message will be vulnerable, so the vast majority of applications will not be vulnerable",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:N"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N/E:P"
} ],
"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-mh2x-fcqh-fmqv"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-53262"
}, {
"type" : "WEB",
"url" : "https://github.com/sveltejs/kit/pull/13050"
}, {
"type" : "WEB",
"url" : "https://github.com/sveltejs/kit/commit/134e36343ef57ed7e6e2b3bb9e7f05ad37865794"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/sveltejs/kit"
}, {
"type" : "WEB",
"url" : "https://github.com/sveltejs/kit/releases/tag/%40sveltejs%2Fkit%402.8.3"
}, {
"type" : "WEB",
"url" : "https://kit.svelte.dev/docs/errors"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2024-11-25T15:32:45Z",
"nvd_published_at" : "2024-11-25T20:15:10Z"
}
}