Low

Sveltia CMS: Stored XSS in Markdown/RichText preview via unsandboxed same-origin iframe

  • Disclosed: 19.06.2026
  • Updated: 11.10.2026 10:22

Impact

A stored cross-site scripting (XSS) vulnerability affected the Markdown/RichText field preview renderer in Sveltia CMS.

The DOMPurify sanitization configuration used for Markdown previews explicitly permitted iframe elements without enforcing a sandbox attribute or restricting iframe sources. Sanitized Markdown output was then inserted into the CMS preview DOM as raw HTML. Because no sandboxing or source validation was applied, a Markdown field containing an iframe whose src pointed to a same-origin uploaded or publicly accessible HTML asset would render an unsandboxed iframe. JavaScript in the framed document could then access the parent CMS window via the browser’s same-origin policy, allowing it to read and write the parent window’s state, DOM, and browser storage, and to trigger actions in the CMS context.

The practical impact is limited in currently supported Sveltia CMS usage because the CMS is intended for a single developer or a small trusted team, and open authoring / untrusted multi-user authoring is not currently implemented. Exploitation requires the ability to place malicious content into the repository or content source that the CMS loads.

Patches

The issue has been patched by replacing the direct DOMPurify call in the Markdown preview renderer with a two-pass sanitization pipeline:

  1. DOMPurify processes the raw HTML as before.
  2. A post-processing step validates every iframe element in the sanitized output. Any iframe whose src does not use an https:// URL, uses a same-origin URL, uses a relative path, or uses any other non-HTTPS scheme (javascript:, data:, blob:, , etc.) is removed from the output. Surviving iframes (HTTPS cross-origin only) have a sandbox attribute enforced with at minimum allow-scripts allow-same-origin, which confines the framed document to its own origin and prevents it from accessing the parent CMS window.

Users should upgrade to Sveltia CMS v0.167.3 or later.

Workarounds

If upgrading is not immediately possible, avoid loading CMS content from untrusted authors and review Markdown field content for iframe elements pointing to same-origin or relative paths.

Administrators can also reduce exposure by limiting repository or content source write access to trusted users only.

References

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
npm package @sveltia/cms < 0.167.3 0.167.3

References

CVSS score -
CVSS vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N/E:U
Weakness (CWE)
CWE-79
Platform
npm
Package
@sveltia/cms
Disclosed
19.06.2026
Updated
11.10.2026 10:22

Sources and licenses

OSV / GitHub Advisory Database - GHSA-h5jc-78hr-3pc9 - CC BY 4.0

Vulnerability history: @sveltia/cms

All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
2
First → latest
05.2026 06.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • Low 2

Disclosures per year

  1. 2026: 2
  1. Sveltia CMS: Stored XSS in Markdown/RichText preview via unsandboxed same-origin iframe this entry
    Low ghsa-h5jc-78hr-3pc9 < 0.167.3 0.167.3

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.