CVE-2026-27122: Svelte SSR HTML Injection Vulnerability Due to Unvalidated Dynamic Element Tag Names

svelte Updated 19 Feb 2026

Summary

19/02/2026
Yes i
Moderate
5.1

CVE-2026-27122: Svelte SSR does not validate dynamic element tag names in. Affects svelte versions < 5.51.5. Fixed in 5.51.5. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Svelte is a modern JavaScript framework for building user interfaces. It allows developers to create reactive components that compile into highly efficient JavaScript code. One of its features is server-side rendering (SSR), which enables rendering components on the server before sending them to the client. However, a vulnerability has been identified in the SSR process related to the use of dynamic element tags.

Vulnerability Detail

The vulnerability arises from the use of the <svelte:element this={tag}> syntax in server-side rendering. When a developer specifies a dynamic tag name, the framework does not validate or sanitize this input before it is included in the HTML output. If the provided tag name contains unexpected characters, it can lead to HTML injection, allowing an attacker to manipulate the rendered output. This could potentially compromise the integrity of the application and expose users to security risks. Client-side rendering is not affected by this issue.

How To Fix

Latest published version: 5.57.2 as of 23 Oct 2026

npm install svelte@5.57.2

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

5.51.5

This is the first release that contains the fix.

npm install svelte@5.51.5

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, avoid using dynamic tag names with <svelte:element> until you can update to the patched version. If dynamic behavior is necessary, ensure that the tag names are hardcoded or validated against a whitelist of safe tag names.

Conclusion

In summary, the vulnerability identified as CVE-2026-27122 in Svelte's server-side rendering can lead to HTML injection due to unvalidated dynamic element tag names. It is crucial to update to version 5.51.5 or later to mitigate this risk. For those unable to update immediately, implementing workarounds is recommended.

See every vulnerability recorded for svelte →

Share this vulnerability

FAQ

The CVSS score for this vulnerability is 5.1, indicating a moderate severity level.

No, this vulnerability only affects server-side rendering in Svelte.

You can use Vulert to monitor and alert for open-source vulnerabilities in your software. Check your application against this vulnerability using the Vulert playground at Vulert Scanner without any signup.

If you cannot update right away, avoid using dynamic tag names with <svelte:element> and consider hardcoding tag names or validating them against a whitelist.

More information can be found in the official advisory on GitHub or by reviewing the Svelte documentation regarding server-side rendering.

Related vulnerabilities

Recent vulnerabilities recorded for svelte.

How To Fix

Latest published version: 5.57.2 as of 23 Oct 2026

npm install svelte@5.57.2

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

5.51.5

This is the first release that contains the fix.

npm install svelte@5.51.5

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback