chore(deps): update dependency svelte to v4.2.19 [security]
This PR contains the following updates:
| Package | Change | Age | Confidence |
|---|---|---|---|
| svelte (source) | 4.2.8 -> 4.2.19 |
GitHub Vulnerability Alerts
CVE-2024-45047
Summary
A potential XSS vulnerability exists in Svelte for versions prior to 4.2.19.
Details
Svelte improperly escapes HTML on server-side rendering. It converts strings according to the following rules:
- If the string is an attribute value:
-
"->" -
&->& - Other characters -> No conversion
-
- Otherwise:
-
<->< -
&->& - Other characters -> No conversion
-
The assumption is that attributes will always stay as such, but in some situation the final DOM tree rendered on browsers is different from what Svelte expects on server-side rendering. This may be leveraged to perform XSS attacks. More specifically, this can occur when injecting malicious content into an attribute within a <noscript> tag.
PoC
A vulnerable page (+page.svelte):
<script>
import { page } from "$app/stores"
// user input
let href = $page.url.searchParams.get("href") ?? "https://example.com";
</script>
<noscript>
<a href={href}>test</a>
</noscript>
If a user accesses the following URL,
http://localhost:4173/?href=</noscript><script>alert(123)</script>
then, alert(123) will be executed.
Impact
XSS, when using an attribute within a noscript tag
Release Notes
sveltejs/svelte (svelte)
v4.2.19
Patch Changes
-
fix: ensure typings for
<svelte:options>are picked up (#β12902) -
fix: escape
<in attribute strings (#β12989)
v4.2.18
Patch Changes
- chore: speed up regex (#β11922)
v4.2.17
Patch Changes
- fix: correctly handle falsy values of style directives in SSR mode (#β11584)
v4.2.16
Patch Changes
- fix: check if svelte component exists on custom element destroy (#β11489)
v4.2.15
Patch Changes
- support attribute selector inside :global() (#β11135)
v4.2.14
Patch Changes
- fix parsing camelcase container query name (#β11131)
v4.2.13
Patch Changes
- fix: applying :global for +,~ sibling combinator when slots are present (#β9282)
v4.2.12
Patch Changes
- fix: properly update
svelte:componentprops when there are spread props (#β10604)
v4.2.11
Patch Changes
- fix: check that component wasn't instantiated in
connectedCallback(#β10466)
v4.2.10
Patch Changes
-
fix: add
scrollendevent type (#β10336) -
fix: add
fetchpriorityattribute type (#β10390) -
fix: Add
miter-clipandarcstostroke-linejoinattribute (#β10377) -
fix: make inline doc links valid (#β10366)
v4.2.9
Patch Changes
Configuration
π Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
π¦ Automerge: Disabled by config. Please merge this manually once you are satisfied.
β» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
π Ignore: Close this PR and you won't be reminded about this update again.
- [ ] If you want to rebase/retry this PR, check this box
This PR was generated by Mend Renovate. View the repository job log.
Visit the preview URL for this PR (updated for commit 989ac20):
- https://techcal-th--pr165-renovate-npm-svelte-74vn6ssg.web.app
- https://techcal-id--pr165-renovate-npm-svelte-6r13ft7p.web.app
- https://techcal--pr165-renovate-npm-svelte-rq1czy9s.web.app
(expires Tue, 28 Oct 2025 10:58:12 GMT)
π₯ via Firebase Hosting GitHub Action π
Sign: 7b89b43096a0297d669b0d75e88f6129966a431d