Svelte is a UI framework known for its "disappearing" act, meaning it compiles your code to highly efficient vanilla JavaScript during the build process, resulting in excellent runtime performance. Comparing versions 1.29.3 and 1.29.2, the core functionality remains consistent, promising the same reactive and component-based development experience. The primary difference lies in the updated development dependencies.
Specifically, version 1.29.3 upgrades rollup from 0.45.2 to 0.47.4. Rollup is a crucial bundler used in the Svelte build process. This update likely includes bug fixes, performance improvements in bundling, and possibly new features exposed to Svelte developers working on the framework itself. For users of Svelte, this change is mostly transparent, but contributes to a more robust and efficient build pipeline for the framework.
Both versions share a wide range of development dependencies like eslint, prettier, and typescript, showcasing a commitment to code quality and modern development practices. These tools help maintain a consistent code style, catch potential errors early, and leverage the benefits of static typing. The presence of testing tools like mocha, nyc, and codecov underlines the importance of thorough testing and code coverage. While the upgrade from 1.29.2 to 1.29.3 is incremental, it reflects ongoing improvements to the underlying tooling, ultimately contributing to a better developer experience for those building Svelte applications. Both versions offer the core benefits of Svelte such as small bundle sizes, high performance and a simple component based approach.
All the vulnerabilities related to the version 1.29.3 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