CVE-2026-27122: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in sveltejs svelte
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 Analysis
Technical Summary
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.
Affected Countries
United States, Germany, United Kingdom, Canada, Australia, France, Japan, Netherlands, India, Brazil
CVE-2026-27122: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in sveltejs 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
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.
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 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Related Threats
CVE-2025-65995: CWE-209 Generation of Error Message Containing Sensitive Information in Apache Software Foundation Apache Airflow
HighCVE-2026-27203: CWE-15: External Control of System or Configuration Setting in YosefHayim ebay-mcp
HighCVE-2026-27168: CWE-122: Heap-based Buffer Overflow in HappySeaFox sail
HighCVE-2026-27134: CWE-287: Improper Authentication in strimzi strimzi-kafka-operator
HighCVE-2026-27190: CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in denoland deno
HighActions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
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.