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-27122: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in sveltejs svelte

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

Description

CVE-2026-27122 is a medium severity cross-site scripting (XSS) vulnerability in the Svelte web framework versions prior to 5. 51. 5. It occurs during server-side rendering (SSR) when using the <svelte:element this={tag}> directive, where the tag name is not properly validated or sanitized. Maliciously crafted tag names containing unexpected characters can lead to HTML injection in the SSR output, potentially enabling attackers to inject arbitrary HTML or scripts. This vulnerability does not affect client-side rendering. Exploitation requires high privileges and authentication, and the attack complexity is high. No known exploits are reported in the wild. The issue is fixed in version 5. 51.

AI-Powered Analysis

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

Technical Analysis

CVE-2026-27122 is a cross-site scripting (XSS) vulnerability identified in the Svelte framework, a performance-oriented web framework widely used for building reactive web applications. The vulnerability specifically affects server-side rendering (SSR) functionality in Svelte versions prior to 5.51.5. When developers use the <svelte:element this={tag}> directive to dynamically specify HTML tag names during SSR, the framework fails to validate or sanitize the provided tag name before embedding it into the generated HTML output. This lack of input neutralization allows an attacker who can influence the tag name to inject arbitrary HTML or script content into the SSR output, leading to HTML injection and potential XSS attacks. Client-side rendering is unaffected because the vulnerability is limited to SSR output generation. The vulnerability is classified under CWE-79 (Improper Neutralization of Input During Web Page Generation). The CVSS 4.0 base score is 5.1 (medium severity), reflecting network attack vector, high attack complexity, required privileges, and no user interaction. The vulnerability requires authenticated access with high privileges, making exploitation more challenging. No known exploits have been reported in the wild as of the publication date. The issue was publicly disclosed on February 20, 2026, and fixed in Svelte version 5.51.5. This vulnerability highlights the importance of input validation and sanitization in SSR contexts to prevent injection attacks.

Potential Impact

The primary impact of CVE-2026-27122 is the potential for HTML injection and cross-site scripting attacks via server-side rendered content in vulnerable Svelte applications. Successful exploitation could allow attackers to execute arbitrary scripts in the context of the affected web application, potentially leading to session hijacking, defacement, or redirection to malicious sites. However, the requirement for high privileges and authentication reduces the likelihood of remote exploitation by unauthenticated attackers. Organizations using Svelte for SSR in web applications may face risks of data exposure, user trust erosion, and compliance issues if this vulnerability is exploited. The impact is limited to applications that dynamically generate tag names via <svelte:element> in SSR, so not all Svelte-based applications are equally affected. Since client-side rendering is not impacted, the scope is narrower. No widespread exploitation has been observed, but the vulnerability could be leveraged in targeted attacks against high-value web applications using vulnerable Svelte versions.

Mitigation Recommendations

To mitigate CVE-2026-27122, organizations should upgrade all Svelte framework instances to version 5.51.5 or later, where the vulnerability is fixed by proper validation and sanitization of tag names in SSR. Developers should audit their codebases for usage of <svelte:element this={tag}> in server-side rendering contexts and ensure that any dynamic tag names are strictly validated against a whitelist of allowed HTML tags before rendering. Implementing a robust input validation layer that rejects or sanitizes unexpected characters in tag names can prevent injection. Additionally, applying Content Security Policy (CSP) headers can help mitigate the impact of potential XSS by restricting script execution. Monitoring and logging SSR output for anomalous tag names or injected content can aid in early detection. Since exploitation requires authenticated access with high privileges, enforcing strong authentication and access controls reduces risk. Finally, educating developers about secure SSR practices and input handling is recommended.

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: 6998e47bbe58cf853bd9f74b

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

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

Last updated: 2/21/2026, 3:48:54 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