GHSA-H5JC-78HR-3PC9
Vulnerability from github – Published: 2026-06-19 21:42 – Updated: 2026-06-19 21:42Impact
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:
- DOMPurify processes the raw HTML as before.
- A post-processing step validates every
iframeelement in the sanitized output. Any iframe whose src does not use anhttps://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 asandboxattribute enforced with at minimumallow-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
- sveltia/sveltia-cms@
8c46294 - https://github.com/sveltia/sveltia-cms/releases/tag/v0.167.3
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "@sveltia/cms"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.167.3"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-79"
],
"github_reviewed": true,
"github_reviewed_at": "2026-06-19T21:42:20Z",
"nvd_published_at": null,
"severity": "LOW"
},
"details": "### Impact\n\nA stored cross-site scripting (XSS) vulnerability affected the Markdown/RichText field preview renderer in Sveltia CMS.\n\nThe 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\u2019s same-origin policy, allowing it to read and write the parent window\u2019s state, DOM, and browser storage, and to trigger actions in the CMS context.\n\nThe 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.\n\n### Patches\n\nThe issue has been patched by replacing the direct DOMPurify call in the Markdown preview renderer with a two-pass sanitization pipeline:\n\n1. DOMPurify processes the raw HTML as before.\n2. 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.\n\nUsers should upgrade to Sveltia CMS [v0.167.3](https://github.com/sveltia/sveltia-cms/releases/tag/v0.167.3) or later.\n\n### Workarounds\n\nIf 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.\n\nAdministrators can also reduce exposure by limiting repository or content source write access to trusted users only.\n\n### References\n\n- [sveltia/sveltia-cms@`8c46294`](https://github.com/sveltia/sveltia-cms/commit/8c46294eadf52a8ac48740ccb5054b99d65cff1b)\n- https://github.com/sveltia/sveltia-cms/releases/tag/v0.167.3",
"id": "GHSA-h5jc-78hr-3pc9",
"modified": "2026-06-19T21:42:20Z",
"published": "2026-06-19T21:42:20Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/sveltia/sveltia-cms/security/advisories/GHSA-h5jc-78hr-3pc9"
},
{
"type": "WEB",
"url": "https://github.com/sveltia/sveltia-cms/commit/8c46294eadf52a8ac48740ccb5054b99d65cff1b"
},
{
"type": "PACKAGE",
"url": "https://github.com/sveltia/sveltia-cms"
},
{
"type": "WEB",
"url": "https://github.com/sveltia/sveltia-cms/releases/tag/v0.167.3"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "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",
"type": "CVSS_V4"
}
],
"summary": "Sveltia CMS: Stored XSS in Markdown/RichText preview via unsandboxed same-origin iframe"
}
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.