Svelte 3.9.2 arrives as a minor update following version 3.9.1, bringing incremental improvements to the popular JavaScript framework known for its cybernetically enhanced web apps and compiler-based approach, delivering efficient and performant front-end solutions. Comparing the two versions reveals subtle but meaningful changes in the development dependencies, showcasing an ongoing commitment to staying current with the evolving JavaScript landscape.
Notably, acorn is updated from version 6.2.0 to 7.0.0, eslint jumps from 6.1.0 to 6.3.0 and rollup is updated from 1.16.6 to 1.20.3. Also typescript is updated from 3.5.2 to 3.5.3. These updates likely incorporate bug fixes, performance enhancements, and potentially new features within those respective tools, indirectly benefiting Svelte developers by improving the overall development experience. The update of source-map-support from 0.5.12 to 0.5.13 could bring improvements around debugging. Also, there are some updates in the @typescript-eslint packages, that could improve typescript code quality.
While the core Svelte functionality remains consistent, these dependency updates highlight the project's dedication to maintaining a modern and robust toolchain. Developers should be aware of these changes, particularly if their projects rely on specific versions of these dependencies. Reviewing the changelogs for acorn, eslint, rollup, and typescript is advisable to fully understand the implications of these updates and ensure compatibility within their Svelte projects. The slight change in unpacked size (2821512 to 2811902) suggests minor adjustments to the compiled output or bundled assets.
All the vulnerabilities related to the version 3.9.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