CSP Allow-list Experiment
Simon Willison · Simon Willison · 2026-05-13
Simon Willison shares a web security experiment demonstrating that a CSP-protected sandboxed iframe can intercept Content Security Policy errors via a custom fetch() and relay them to the parent window to drive an interactive domain allow-list approval flow.
Appears in
Extraction
Topics: content-security-policyweb-securityiframesai-assisted-programming
Claims
- A sandboxed iframe can use a custom fetch() implementation to intercept CSP violations before they silently fail.
- CSP errors caught inside the iframe can be forwarded to the parent window to trigger a user-facing domain allow-list prompt.
- The experiment was built using GPT-5.5 xhigh running in the Codex desktop app.
Key quotes
An experiment that shows that you can load an app in a CSP-protected sandboxed iframe and have a custom fetch() that intercepts CSP errors and passes them up to the parent window... which can then prompt the user to add that domain to an allow-list and then refresh the page.