Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2026-27121: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in sveltejs svelte

0
Medium
VulnerabilityCVE-2026-27121cvecve-2026-27121cwe-79
Published: Fri Feb 20 2026 (02/20/2026, 22:27:36 UTC)
Source: CVE Database V5
Vendor/Project: sveltejs
Product: svelte

Description

CVE-2026-27121 is a cross-site scripting (XSS) vulnerability affecting svelte versions prior to 5. 51. 5 during server-side rendering. The issue arises when untrusted data is spread as element attributes, allowing malicious event handlers to be injected into rendered HTML. This can lead to execution of arbitrary scripts in users' browsers without requiring user interaction. The vulnerability has a CVSS 4. 0 base score of 5. 1, indicating medium severity, with high attack complexity and privileges required. No known exploits are currently reported in the wild. The vulnerability is fixed in svelte version 5.

AI-Powered Analysis

AILast updated: 02/20/2026, 23:03:42 UTC

Technical Analysis

CVE-2026-27121 is a cross-site scripting (XSS) vulnerability classified under CWE-79 that affects the svelte JavaScript framework versions prior to 5.51.5. Svelte is a performance-oriented web framework that supports server-side rendering (SSR). The vulnerability occurs specifically when developers use the spread syntax to apply attributes to HTML elements from untrusted or external data sources. In such cases, event handler properties (e.g., onclick, onmouseover) included in the spread data are rendered directly into the HTML output during SSR. This improper neutralization of input allows attackers to inject malicious event handlers that execute arbitrary JavaScript code in the context of the victim's browser. The vulnerability requires that the application spreads user-controlled data as element attributes without proper sanitization or validation. Exploitation does not require user interaction but does require that the attacker can influence the data being spread. The CVSS 4.0 vector indicates network attack vector, high attack complexity, privileges required, no user interaction, and limited confidentiality impact. The vulnerability was published on February 20, 2026, and fixed in svelte version 5.51.5. No known exploits have been reported in the wild to date. This vulnerability highlights the risks of using spread syntax with untrusted data in SSR contexts without proper input handling, emphasizing the need for secure coding practices in modern web frameworks.

Potential Impact

The primary impact of CVE-2026-27121 is the potential for cross-site scripting attacks, which can lead to unauthorized script execution in end users' browsers. This can result in session hijacking, credential theft, defacement, or redirection to malicious sites, undermining user trust and application integrity. Organizations using vulnerable svelte versions in web applications that accept and render untrusted input via attribute spreads are at risk. The medium CVSS score reflects that exploitation requires certain conditions, such as the ability to influence attribute data and privileges to deploy vulnerable code, limiting widespread automated exploitation. However, successful attacks could compromise confidentiality and integrity of user data and potentially disrupt availability if malicious scripts perform destructive actions. The vulnerability affects any web application using svelte SSR with untrusted attribute spreading, which may include enterprise web portals, SaaS platforms, and public-facing websites. The absence of known exploits suggests limited current active threat but does not preclude future exploitation as awareness grows. Overall, the impact is significant for affected applications but can be effectively mitigated through patching and secure coding.

Mitigation Recommendations

1. Upgrade all svelte instances to version 5.51.5 or later, where this vulnerability is fixed. 2. Avoid spreading untrusted or external data directly as element attributes during server-side rendering. 3. Implement strict input validation and sanitization on any data used in attribute spreads to exclude event handler properties or other executable content. 4. Use allowlists to control which attributes can be spread or rendered dynamically. 5. Conduct code reviews focusing on usage of spread syntax in SSR contexts to identify potential injection points. 6. Employ Content Security Policy (CSP) headers to restrict execution of inline scripts and mitigate impact of potential XSS. 7. Monitor application logs and user reports for suspicious activity indicative of XSS exploitation attempts. 8. Educate developers on secure usage patterns in svelte and risks of spreading untrusted data. 9. Test applications with security scanners and penetration testing tools that detect XSS vulnerabilities in SSR frameworks. 10. Maintain an update process to promptly apply security patches for svelte and related dependencies.

Need more detailed analysis?Upgrade to Pro Console

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-02-17T18:42:27.043Z
Cvss Version
4.0
State
PUBLISHED

Threat ID: 6998e47bbe58cf853bd9f748

Added to database: 2/20/2026, 10:47:23 PM

Last enriched: 2/20/2026, 11:03:42 PM

Last updated: 2/21/2026, 3:48:45 AM

Views: 3

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console in Console -> Billing for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats