Sveltia CMS Security Fix 5.4.1: What We Reported and What to Do
We reported a low-severity Sveltia CMS security bug in the Markdown preview. It was fixed in 5.4.1. What it was, who it affects, and what to check on your site.
In this post

Two of our Jekyll themes, Spica and Alcor, come with Sveltia CMS, so we wanted to know how safe it is. This week we read through its code and found a Sveltia CMS security bug in the Markdown preview, which we reported privately. The maintainer fixed it the same day in version 5.4.1 and published it as GHSA-4qrc-8wmw-237h, with credit to us.
Quick answer
- It’s rated low. It needs someone who can already add content to your site.
- It’s fixed in Sveltia CMS 5.4.1. All versions up to 5.4.0 are affected.
- If your site loads Sveltia from unpkg without a version number, as Spica and Alcor do, you already have the fix. You don’t need to do anything.
- If you pinned an older version, update to 5.4.1 or later.
What the Sveltia CMS security bug was
Sveltia shows a live preview next to each Markdown or RichText field. You can put an <iframe> in your content, for a video for example, and the preview shows it.
An earlier fix (GHSA-h5jc-78hr-3pc9) made the preview drop any iframe pointing at the CMS’s own address. It kept iframes from other sites and gave them a sandbox that still let them run scripts and keep their own origin.
The check only looked at the address the iframe started on. A page inside an iframe can move to another address, and the sandbox settings move with it. So an iframe could start on an outside page, then jump to a page on the CMS’s own site. If that page carried an attacker’s script, it could reach the CMS window and its browser storage, where Sveltia keeps your Git sign-in token.
Who could actually use it
Not many people. The attacker needs two things:
- a way to put content into your repository, so the iframe appears in an entry someone opens in the CMS
- an HTML file with their script, served from the same site as the CMS (for example, a file committed to your site’s static folder when the CMS runs at
/admin/)
That means someone who can already commit to your site. Sveltia is built for a single developer or a small team you trust, and the advisory points out that pull requests from forks aren’t loaded in the CMS, so outside content only reaches it after you’ve reviewed and merged it.
What changed in 5.4.1
Only YouTube and Vimeo embeds keep their own origin in the preview now. Every other iframe runs in a blank, isolated origin, so nothing it loads can reach the CMS, even a page from your own site.
One side effect: an embed from another service that needs cookies or storage may not work in the preview. Your saved content and the published site aren’t affected.
What to check on your site
Open the admin/index.html file in your site and look at the script line.
<script src="https://unpkg.com/@sveltia/cms/dist/sveltia-cms.js"></script>
- No version in the address (as above, and in Spica and Alcor): this always loads the newest release, so you have 5.4.1 already.
@sveltia/cms@5: this loads the newest 5.x release, which includes the fix. Our Astro setup guide uses this form.- An exact version, like
@sveltia/cms@5.3.0, or the npm package: change it to 5.4.1 or later.
Sveltia supports only its latest version, and the release notes say the fix won’t be added to the old 0.x line. If you’re still on 0.x, now is a good time to move to v5.
If you can’t update straight away, the advisory suggests checking Markdown content for <iframe> tags before you merge it. Running the CMS on its own subdomain, with no untrusted HTML files on it, also blocks the problem.
How we reported it
Sveltia’s security policy asks for reports by email, not public issues, so that’s what we did. We sent the details, how we confirmed the bug on our own computer, and a suggested fix. We didn’t post anything publicly until the advisory was out.
The rest of what we checked came up clean. That included the GitHub sign-in flow, how the CMS stores your token, how it cleans HTML in previews, and how it builds file paths.
If you use Sveltia with Spica or Alcor and something looks wrong after the update, get in touch.