Sitesmith self-review capture: sanitise page HTML before it reaches the frame (inert DOMParser allow-list, fixed-point guard), CSP + script-less sandbox, real-browser hostile-page proof; UI building blocks (attachments, sites I like, asset awareness, design payload)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
shadowdaoandClaude Sonnet 5.5 committed 2026-11-01 10:31:29 -08:00
1 parent 0fde4dc22f
commit 197b9c46ab
14 files changed
+965 -10

No files matched your search

@@ -0,0 +1,16 @@
// Bundled by scripts/e2e-capture-security.mjs and run in real Firefox + Chromium.
import { captureHtml } from '../src/utils/self-review-capture';
import { captureCsp } from '../src/utils/sanitize-capture-html';
(window as any).captureHtml = captureHtml;
/** Defence-in-depth probe: the capture frame WITHOUT the sanitiser (sandbox + CSP only). */
(window as any).rawFrame = (html: string) => new Promise<void>((resolve) => {
const f = document.createElement('iframe');
f.setAttribute('sandbox', 'allow-same-origin');
const CSP = captureCsp(location.origin);
f.setAttribute('csp', CSP);
f.style.cssText = 'position:fixed;left:-9999px;width:800px;height:600px';
f.addEventListener('load', () => setTimeout(resolve, 800), { once: true });
f.srcdoc = html.replace('<head>', `<head><meta http-equiv="Content-Security-Policy" content="${CSP}">`);
document.body.appendChild(f);
});