Svelte 0.0.1, a groundbreaking initial release of the "magical disappearing UI framework," marks the very beginning of what has become a significant player in the modern web development landscape. Released in November 2016, this early iteration laid the foundation for Svelte's core principles: compiling components into highly efficient vanilla JavaScript during build time.
Looking at Svelte 0.0.1, developers would find a lean dependency list, relying on acorn for Javascript parsing and locate-character. For development, jsdom and mocha aided in testing, while reify and eslint supported code quality and style. This minimalistic setup suggests an early focus on core functionality and a commitment to a streamlined development experience. While this version lacked the refined features and extensive ecosystem of later releases, it represented a radical shift in UI framework thinking.
Compared to subsequent stable releases (data unavailable), one could anticipate significant differences. Later versions address developer pain points and add features like reactivity, templating syntax, lifecycle methods, and advanced DOM manipulation. The developer toolchain would have grown, with improved component structure, tooling, testing, and debugging. This initial version provided the seed for later innovations, and while rudimentary compared to current standards, was a bold first step toward a novel approach to front-end development.
All the vulnerabilities related to the version 0.0.1 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