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.
| 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:
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.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.connect-src 'self' https://api.github.com).frankenstein.config.json on your own origin, never from the URL or from another window.*.html pages and img/ PNG/JPG/GIF/WebP/AVIF/ICO
images: no .github/ workflows, scripts, configs or SVG (SVG can contain scripts).repo scope: that reaches every
repository you own. If a token leaks, revoke it and create a new one.workers.dev address (same page). WAF rules
protect your domain; the plain *.workers.dev address would bypass them. Then use the custom
domain as bouncerUrl.sites.php (copy
prod/worker/sites.example.php) or put sites.json one folder above bouncer.php; a plain
sites.json next to the script is refused. prod/worker/.htaccess already denies those
files on Apache. nginx: location ~ /(sites\.(json|php)|clients\.json)$ { deny all; }.
Set FRANKENSTEIN_TRUST_PROXY=1 only if you are behind Cloudflare (so the throttle sees
real client addresses) and FRANKENSTEIN_ALLOWED_ORIGIN to your CMS origin.--no-verify-jwt, keep Row Level Security ON (the SQL does this),
never put the service-role key anywhere but the function’s secrets. Set ALLOWED_ORIGIN.prod/index.html allows connect-src https: because your bouncer address is
not known in advance. Replace https: http://localhost:* http://127.0.0.1:* in that meta
tag with your exact bouncer origin(s), e.g. https://bouncer.example.com.dev/iframe.html points at the original author’s hosted
copy: whoever hosts the page you log in on can read what you type. Change its src to your own.<meta> tag cannot forbid framing and GitHub Pages cannot send headers.
If your host can (Cloudflare Pages / Netlify _headers, nginx, Apache), add
Content-Security-Policy: frame-ancestors 'self' (or your embedding site) and
X-Frame-Options: SAMEORIGIN.| 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 |
sites.php: protected by
your account security, not by encryption. Turn on 2FA for Cloudflare/Supabase/GitHub.<script>. Only give accounts to people you trust with their own site.@supabase/supabase-js from esm.sh (pin a full version
if you deploy it). Sites’ own external stylesheets are loaded in the preview.style-src still allows inline styles and any https stylesheet (needed to show your site).Please report vulnerabilities privately to the repository owner (GitHub: Security → Report a vulnerability) instead of opening a public issue.