Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): Svelte has a potential mXSS vulnerability due to improper HTML escaping #4713

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sfatmdev
Copy link

Changes proposed in this pull request:

A potential XSS vulnerability exists in Svelte for versions prior to 4.2.19. 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 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

CVE-2024-45047
CWE-79

Signed-off-by: スシ・ファトマワティ <sfatm@securityuniverse.id>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant