GHSA-h5jc-78hr-3pc9: Sveltia CMS Cross-Site Scripting Vulnerability

LOW
CWE-79
Published
Advisory Summary

GHSA-h5jc-78hr-3pc9 is a LOW cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Sveltia CMS libraries in the npm ecosystem. The issue involves stored xss in markdown/richtext preview via unsandboxed same-origin iframe. Remediation is available by upgrading affected packages to version 0.167.3.

GHSA-h5jc-78hr-3pc9 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-h5jc-78hr-3pc9
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Sveltia CMS
Package Ecosystem npm
Published Date
Last Updated

How to Fix GHSA-h5jc-78hr-3pc9

To remediate this vulnerability, upgrade all affected Sveltia CMS dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@sveltia/cms fixed: 0.167.3
npm install @sveltia/cms@0.167.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @sveltia/cms

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-h5jc-78hr-3pc9, inspect your project dependencies using npm:

npm ls @sveltia/cms

Analyze the terminal output to locate any version of Sveltia CMS in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.167.3), your application is affected.

Note: The npm ls @sveltia/cms command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Sveltia CMS, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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 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](https://github.com/sveltia/sveltia-cms/releases/tag/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/commit/8c46294eadf52a8ac48740ccb5054b99d65cff1b) - https://github.com/sveltia/sveltia-cms/releases/tag/v0.167.3

GHSA-h5jc-78hr-3pc9 Affected Sveltia CMS Versions

1 component(s)
Fixed Versions:
0.167.3
Product / Package Ecosystem Affected Versions Fixed Version
@sveltia/cms
npm
< 0.167.3
0.167.3

References

Frequently Asked Questions

What is GHSA-h5jc-78hr-3pc9?
GHSA-h5jc-78hr-3pc9 is a security vulnerability in Sveltia CMS involving Stored XSS in Markdown/RichText preview via unsandboxed same-origin iframe under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Sveltia CMS versions are affected?
Affected versions include releases prior to 0.167.3 across affected packages: @sveltia/cms.
What version fixes GHSA-h5jc-78hr-3pc9?
Upgrading to 0.167.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @sveltia/cms affected?
Yes, @sveltia/cms is affected in releases prior to 0.167.3. Upgrade your dependency to 0.167.3 or later.
What CWE is associated with GHSA-h5jc-78hr-3pc9?
GHSA-h5jc-78hr-3pc9 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check npm dependencies for GHSA-h5jc-78hr-3pc9?
Run the dependency tree command: 'npm ls @sveltia/cms'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-h5jc-78hr-3pc9",
  "modified" : "2026-06-19T21:42:20Z",
  "published" : "2026-06-19T21:42:20Z",
  "aliases" : [ ],
  "summary" : "Sveltia CMS: Stored XSS in Markdown/RichText preview via unsandboxed same-origin iframe",
  "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’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.\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",
  "severity" : [ {
    "type" : "CVSS_V4",
    "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@sveltia/cms"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.167.3"
      } ]
    } ]
  } ],
  "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"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-19T21:42:20Z",
    "nvd_published_at" : null
  }
}