Svelte version 1.11.2 represents a minor update to the 1.11.x series, following closely on the heels of version 1.11.1. Both versions share the same core description as "The magical disappearing UI framework," highlighting Svelte's key feature of compiling components to highly efficient vanilla JavaScript during build time, resulting in incredibly fast and performant web applications. Examining the package.json data, we see that the dependency on magic-string remains consistent at version ^0.19.0, suggesting no API-breaking changes were introduced in this area. The devDependencies also appear identical, indicating the toolchain used for development, testing, and bundling remained stable between the two releases. This shared tooling includes popular libraries like rollup for bundling, eslint for linting, mocha for testing, and a suite of Babel plugins for ES2015 transformations, signifying a modern JavaScript development environment which would attract many frontend developers.
The primary difference lies in the releaseDate. Version 1.11.2 was published on March 10, 2017, while 1.11.1 was released on March 8, 2017, a mere two days prior. This tight release cadence suggests that version 1.11.2 likely addresses a bug fix or minor improvement identified shortly after the release of 1.11.1, though a full changelog would provide definitive context. For developers, this means upgrading to 1.11.2 from 1.11.1 is highly recommended to benefit from the latest stability enhancements. Given the identical dependency tree, the upgrade should be seamless and without breaking changes. Svelte's approach to build-time compilation remains a strong draw, offering a compelling alternative to traditional virtual DOM frameworks.
All the vulnerabilities related to the version 1.11.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