Skip to main content

Svelte CVE-2026-42599

| EUVDEUVD-2026-35703 MEDIUM
Cross-site Scripting (XSS) (CWE-79)
2026-05-14 https://github.com/sveltejs/svelte GHSA-pr6f-5x2q-rwfp
5.1
CVSS 4.0 · Vendor: https://github.com/sveltejs/svelte
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Attacker supplies malicious data with event handler property
  2. Delivery
    Application spreads data as element attributes
  3. Exploit
    Vulnerable Svelte version renders event handler in HTML output
  4. Execution
    Victim's browser parses malicious HTML attribute
  5. Persist
    Victim interacts with element before hydration
  6. Impact
    Injected event handler executes with victim's privileges

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

The vulnerability triggers only under all of the following conditions: (1) the application uses Svelte spread syntax ({...data}) to bind attributes to HTML elements, (2) the spread data source is untrusted or user-controlled (e.g., from a user input, external API, database, or URL parameter), (3) the victim's browser has JavaScript enabled, and (4) Svelte's hydration mechanism does not process the vulnerable element before a user interaction triggers the injected event handler. The window of vulnerability is narrow-it exists only during the time between when the browser parses the malicious HTML and when Svelte hydration attaches event listeners to the element. Applications that (a) only spread explicitly whitelisted internal properties, (b) validate and sanitize all external data before spreading, or (c) use normal attribute binding instead of spread syntax for dynamic attributes are not affected. Partial hydration strategies or components with deferred hydration create a wider exploitation window.

Impact

This vulnerability requires specific deployment and usage conditions to trigger: the application must use spread syntax with untrusted data, JavaScript must be enabled in the victim's browser, and Svelte's hydration mechanism must fail to process the element before the injected event fires. The CVSS vector is not provided, limiting standard risk quantification; however, the attack vector is clearly network-based (HTTP-delivered malicious data), privilege requirement is none (unauthenticated attacker can supply data), and user interaction is implicit (victim must trigger the injected event, such as by hovering or clicking). The CWE-79 classification confirms this as XSS. Real-world risk depends heavily on how the application implements spread syntax and whether hydration is reliably applied; applications that hydrate all dynamic elements immediately or avoid spreading untrusted data directly face lower risk. The condition that hydration must not reach the element creates a window of vulnerability that exists primarily in race conditions or partial hydration scenarios. No EPSS, KEV, or POC data is provided, so the current exploitation status cannot be confirmed; however, the detailed nature of the vulnerability description and the existence of a fix commit suggest this represents a genuine code-path vulnerability rather than a theoretical issue.

Exploit ScenarioDerived

An attacker controls or injects data that becomes an application object spread as element attributes-for example, via a user profile field, API response, or URL parameter. The malicious object contains an event handler property like onclick with a payload: {onclick: 'alert(document.cookie)'}. When the Svelte component renders this on the server, the vulnerable code includes the event handler in the HTML output as a literal attribute: <div onclick='alert(document.cookie)'>. The victim's browser receives this HTML. If Svelte's hydration has not yet attached to this element when the victim hovers or clicks it, the injected event handler executes in the victim's browser context, allowing JavaScript execution such as session theft or malware delivery.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – May 14, 2026

Cross-site scripting in Svelte versions up to 5.55.6 allows remote attackers to inject malicious event handlers via spread syntax when rendering untrusted data as element attributes. The vulnerability executes in victims' browsers only when JavaScript is enabled and Svelte's hydration mechanism does not process the vulnerable element before the injected event fires. Vendor-released patch: version 5.55.7.

RemediationAI

Upgrade Svelte to version 5.55.7 or later immediately. The patched version moves Svelte runtime properties to symbols, preventing them from being included in spread attribute output, and hardens attribute handling during SSR. Organizations unable to upgrade immediately should avoid using spread syntax ({...data}) with untrusted data sources as element attributes; instead, explicitly bind known-safe attributes using normal attribute binding syntax, or pre-validate and sanitize external data before spreading. Ensure all dynamic components are hydrated early in the page load before user interactions can trigger injected events. Review any server-side templates or components that use spread syntax to identify and remediate patterns that accept external or user-controlled data.

Affected VersionsENISA

svelte < 5.55.7

Affected Packages

npm svelte fix: 5.55.7

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in npm

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Svelte is a JavaScript framework that compiles components to vanilla JavaScript at build time. The vulnerability exists in Svelte's server-side rendering (SSR) layer when using spread syntax ({...data}) to apply user-controlled or external data as HTML element attributes. Unlike traditional frameworks that handle attribute binding at runtime, Svelte's compilation process should sanitize spread attributes to prevent event handler properties (such as onclick, onmouseover) from being rendered as literal HTML attributes. The underlying issue is classified as CWE-79 (Improper Neutralization of Input During Web Page Generation), a cross-site scripting flaw. The affected component npm/svelte <= 5.55.6 fails to neutralize event handler properties during SSR, allowing them to pass through as rendered HTML. The fix moves Svelte runtime properties to symbols and hardens the handling of spread attributes, preventing event handler injection during the hydration process.

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/sveltejs/svelte) PRIMARY 5.1 MEDIUM
CVSS:4.0/AV:N/AC:H/AT:P/PR:H/UI:N/VC:N/VI:N/VA:N/SC:H/SI:H/SA:N
Red Hat 4.2 MEDIUM

Primary rating from Vendor (https://github.com/sveltejs/svelte).

CVSS VectorVendor: https://github.com/sveltejs/svelte

Attack Vector
Network
Attack Complexity
High
Attack Requirements
Present
Privileges Required
High
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
None
Subsequent system: Confidentiality
High
Subsequent system: Integrity
High
Subsequent system: Availability
None

Lifecycle Timeline

2
CVSS changed
Jun 09, 2026 - 17:22 NVD
5.1 (MEDIUM)
CVE Published
May 14, 2026 - 20:19 nvd
MEDIUM

DescriptionCVE.org

When using spread syntax to render attributes from untrusted data, event handler properties are included in the rendered HTML output. If an application spreads user-controlled or external data as element attributes, an attacker can inject malicious event handlers that execute in victims' browsers. Note that this vulnerability _only_ triggers if the user's browser has JavaScript enabled but Svelte's hydration mechanism does not reach the vulnerable element before the event fires.

This is similar to but different from CVE-2026-27121.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 11 npm packages depend on svelte (7 direct, 4 indirect)

Ecosystem-wide dependent count for version 5.55.7.

Threat Intelligence Overview

EPSS Score
0.0%
Top 86% exploitable
Threat Intel
1
1 source
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS GHSA Vendor GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

26
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +26
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy