Svelte is a JavaScript framework lauded for its "magical disappearing UI" approach, compiling components into highly efficient vanilla JavaScript at build time, resulting in smaller bundle sizes and improved runtime performance. Comparing versions 1.1.2 and 1.1.1, while the core functionality remains consistent, the subtle differences can impact developers. Both versions share the same core development dependencies, including tools for linting (eslint), bundling (rollup), testing (mocha, nyc), and source map generation. This indicates a focus on maintaining code quality and developer experience. The identical set of devDependencies suggests that the core compilation process and testing methodologies remained stable between these releases.
However, examining the release dates reveals that version 1.1.2 was released just a couple of hours after 1.1.1. This short interval strongly suggests that 1.1.2 is likely a patch release addressing a bug or minor issue discovered in 1.1.1. Developers should, therefore, upgrade to 1.1.2 to ensure they have the most stable and reliable version. While a detailed changelog isn't available in the provided data, such rapid releases typically focus on fixing immediate problems.
For developers considering Svelte, understanding this context is important. The consistent development dependencies highlight Svelte's commitment to modern tooling and best practices. Checking the project's GitHub repository for commit history or release notes associated with the 1.1.2 tag is recommended to fully understand the specific fixes included in this version. As Svelte continues to evolve, these small iterative improvements contribute to its overall stability and performance.
All the vulnerabilities related to the version 1.1.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