Frankenstein-CMS

Security

Frankenstein CMS handles credentials that can change your websites, so this page says what is protected, what you must configure yourself, and what is still a risk.

How it works, and what an attacker would want

  dev/ (direct) prod/ (bouncer)
Secret your GitHub token, in the browser clients only know email + password; the token stays on the bouncer
Where it lives encrypted in localStorage, key in IndexedDB (non-extractable) in the bouncer: Cloudflare KV / Supabase table / sites.php
Worst case if stolen write access to the repos the token covers write access to ONE repo’s pages and images

The browser is the weak spot: any script that runs on the CMS page can use the stored token. The defences are layered so that one mistake is not enough:

  1. No script can run except the CMS’s own files. The Content-Security-Policy is script-src 'self'; the page has no inline handlers or scripts (js/actions.js dispatches clicks), so injected <script> / onerror= markup does nothing even if it gets in.
  2. Repository content is sanitised before it touches the page. Pages you open are parsed in an inert document, stripped of scripts, event handlers, javascript:-style URLs (including tab/newline-obfuscated ones), srcdoc, SVG animation tricks, and only then moved into the preview. Saved files are built from the original, never from the preview.
  3. The token can only be sent to GitHub (dev: connect-src 'self' https://api.github.com).
  4. Passwords are only sent over https to a bouncer address that comes from frankenstein.config.json on your own origin, never from the URL or from another window.
  5. The bouncer is not an open proxy. It forwards only what the CMS needs, only for that client’s repo, and clients may only write *.html pages and img/ PNG/JPG/GIF/WebP/AVIF/ICO images: no .github/ workflows, scripts, configs or SVG (SVG can contain scripts).

Do this when you deploy

What the review found (and fixed)

Severity Problem Fix
High prod login took the bouncer URL from ?bouncer=…: a crafted link could send a client’s password to an attacker honoured only when framed by a same-origin page; https required; never from messages
High CSP had 'unsafe-inline' and 28 inline handlers, so any HTML injection could run script and read the token inline handlers/scripts removed, script-src 'self'
High repo HTML was loaded into the live page and sanitised afterwards (<img onerror> could fire first) sanitised in an inert document, nodes imported, never re-parsed
High PHP read sites.json (passwords + tokens) from the public folder refused; sites.php / parent-folder / env path; .htaccess
Medium clients could write any file in their repo (workflows, scripts) and upload SVG write allowlist in all four bouncers; SVG refused
Medium unknown email answered differently from wrong password (Supabase, Node) identical response and delay
Medium Supabase returned every GitHub header (token scopes, expiry); Node echoed upstream errors short header list; generic error
Medium service worker could cache a same-origin bouncer’s responses (repo contents) only the app’s own files are cached
Medium message events accepted from any window; owner/repo from URL unchecked parent-only, validated names
Medium only a sleep against password guessing; sleep also ties up PHP workers per-address throttle (429); shorter sleep
Low java⇥script: links slipped past the URL check scheme read after removing invisible characters; allowlist
Low Quill 1.3.6 from a CDN (tabnabbing flaw) Quill 1.3.7 bundled, no CDN
Low no request size limit 8 MB cap

Still a risk (read this)

Reporting a problem

Please report vulnerabilities privately to the repository owner (GitHub: Security → Report a vulnerability) instead of opening a public issue.