GHSA-mh2x-fcqh-fmqv
Vulnerability from github
1.3 (Low) - 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
Summary
The static error.html template for errors contains placeholders that are replaced without escaping the content first.
Details
From https://kit.svelte.dev/docs/errors:
error.html is the page that is rendered when everything else fails. It can contain the following placeholders: %sveltekit.status% — the HTTP status %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 that ends up being something like this inside a server handle function:
js
error(500, '<script>alert("boom")</script>');
Uncaught errors cannot be exploited like this, as they always render the message "Internal error".
Escaping 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.
PoC
None provided
Impact
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
{ "affected": [ { "package": { "ecosystem": "npm", "name": "@sveltejs/kit" }, "ranges": [ { "events": [ { "introduced": "0" }, { "fixed": "2.8.3" } ], "type": "ECOSYSTEM" } ] } ], "aliases": [ "CVE-2024-53262" ], "database_specific": { "cwe_ids": [ "CWE-79" ], "github_reviewed": true, "github_reviewed_at": "2024-11-25T15:32:45Z", "nvd_published_at": "2024-11-25T20:15:10Z", "severity": "LOW" }, "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\u003e error.html is the page that is rendered when everything else fails. It can contain the following placeholders:\n%sveltekit.status% \u2014 the HTTP status\n%sveltekit.error.message% \u2014 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, \u0027\u003cscript\u003ealert(\"boom\")\u003c/script\u003e\u0027);\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", "id": "GHSA-mh2x-fcqh-fmqv", "modified": "2024-11-25T21:46:57Z", "published": "2024-11-25T15:32:45Z", "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" } ], "schema_version": "1.4.0", "severity": [ { "score": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:N", "type": "CVSS_V3" }, { "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", "type": "CVSS_V4" } ], "summary": "@sveltejs/kit has unescaped error message included on error page" }
Sightings
Author | Source | Type | Date |
---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
- Confirmed: The vulnerability is confirmed from an analyst perspective.
- Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
- Patched: This vulnerability was successfully patched by the user reporting the sighting.
- Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
- Not confirmed: The user expresses doubt about the veracity of the vulnerability.
- Not patched: This vulnerability was not successfully patched by the user reporting the sighting.