Svelte 3.29.2 is a minor version update to the Svelte JavaScript framework, following closely after version 3.29.1. Both versions share the same core description, emphasizing Svelte's capability to create "cybernetically enhanced web apps." Examining the package.json files reveals subtle differences, primarily in the dist section which details the distribution package. The unpacked size of Svelte 3.29.2 is slightly larger at 2441247 bytes compared to 2441181 bytes in 3.29.1, a mere 66 bytes difference.
The release dates are also very close, with 3.29.2 released approximately 20 minutes after 3.29.1. This suggests that 3.29.2 likely contains a small bug fix or minor adjustment to the immediately preceding release. For developers, this quick turnaround implies a commitment to stability and rapid issue resolution.
While the core devDependencies remain identical between the two versions, crucial for development and testing, the minor increase in unpacked size and rapid release cycle highlights the importance of staying up-to-date with the latest patches. Developers already using Svelte 3.29.1 are encouraged to upgrade to 3.29.2 ensuring optimal performance and benefit from any bug fixes introduced. The identical dependency list indicates a smooth transition, minimizing potential compatibility issues with existing projects. This makes upgrading a low-risk opportunity to leverage the most current improvements to Svelte.
All the vulnerabilities related to the version 3.29.2 of the package
Svelte vulnerable to XSS when using objects during server-side rendering
The package svelte before 3.49.0 is vulnerable to Cross-site Scripting (XSS) due to improper input sanitization and to improper escape of attributes when using objects during SSR (Server-Side Rendering). Exploiting this vulnerability is possible via objects with a custom toString() function.
Svelte has a potential mXSS vulnerability due to improper HTML escaping
A potential XSS vulnerability exists in Svelte for versions prior to 4.2.19.
Svelte improperly escapes HTML on server-side rendering. It converts strings according to the following rules:
"
-> "
&
-> &
<
-> <
&
-> &
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.
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.
XSS, when using an attribute within a noscript tag