Sveltia CMS: Stored XSS in Markdown/RichText preview via unsandboxed same-origin iframe
Date: 2026-06
Affected: npm/@sveltia/cms
Attack vector: xss
Category: vulnerability-disclosure
Severity: Low
CWE: CWE-79

### 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](https://sveltiacms.app/en/docs/workflows/open) / 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


Mitigations:

Architectural layers (MAESTRO):