Live
Black Hat USAAI BusinessBlack Hat AsiaAI BusinessRunning Local AI Models for Coding in 2026: When Cloud Tools Are Not the AnswerDev.to AIDay 4: I Built a Migration Tool for 500+ Developers in One HeartbeatDev.to AIHow I Stopped Blindly Trusting Claude Code Skills (And Built a 9-Layer Security Scanner)Dev.to AIAI Code Review Is the New Bottleneck: Why Faster Code Is Not Reaching Production FasterDev.to AIIntelligence vs. Orchestration: Why Coordination Alone Can't Run a BusinessDev.to AII Built a Memory System Because I Die Every 30 MinutesDev.to AIAutomating Repetitive Tasks with WorkanyDev.to AITop Skills by Category — 2026-04-04Dev.to AISandbox Results — Runtime Behavior — 2026-04-04Dev.to AIHigh-Risk Authors — Malicious Accounts — 2026-04-04Dev.to AIWhat the Architects of AI Are Actually Saying About Your CareerMedium AIGoogle Just Admitted the Internet Is Breaking (And Most People Missed It)Medium AIBlack Hat USAAI BusinessBlack Hat AsiaAI BusinessRunning Local AI Models for Coding in 2026: When Cloud Tools Are Not the AnswerDev.to AIDay 4: I Built a Migration Tool for 500+ Developers in One HeartbeatDev.to AIHow I Stopped Blindly Trusting Claude Code Skills (And Built a 9-Layer Security Scanner)Dev.to AIAI Code Review Is the New Bottleneck: Why Faster Code Is Not Reaching Production FasterDev.to AIIntelligence vs. Orchestration: Why Coordination Alone Can't Run a BusinessDev.to AII Built a Memory System Because I Die Every 30 MinutesDev.to AIAutomating Repetitive Tasks with WorkanyDev.to AITop Skills by Category — 2026-04-04Dev.to AISandbox Results — Runtime Behavior — 2026-04-04Dev.to AIHigh-Risk Authors — Malicious Accounts — 2026-04-04Dev.to AIWhat the Architects of AI Are Actually Saying About Your CareerMedium AIGoogle Just Admitted the Internet Is Breaking (And Most People Missed It)Medium AI
AI NEWS HUBbyEIGENVECTOREigenvector

Can JavaScript Escape a CSP Meta Tag Inside an Iframe?

Simon Willison Blogby Simon WillisonApril 3, 20261 min read1 views
Source Quiz

Research: Can JavaScript Escape a CSP Meta Tag Inside an Iframe? In trying to build my own version of Claude Artifacts I got curious about options for applying CSP headers to content in sandboxed iframes without using a separate domain to host the files. Turns out you can inject tags at the top of the iframe content and they'll be obeyed even if subsequent untrusted JavaScript tries to manipulate them. Tags: iframes , security , javascript , content-security-policy , sandboxing

Research

Can JavaScript Escape a CSP Meta Tag Inside an Iframe? — JavaScript running inside a sandbox="allow-scripts" iframe cannot escape or disable a `` tag, even through removal, modification, or document replacement. Extensive testing across Chromium and Firefox confirmed that CSP policies defined via meta tags are enforced at parse time, and persist even when the iframe is navigated to a data: URI.

In trying to build my own version of Claude Artifacts I got curious about options for applying CSP headers to content in sandboxed iframes without using a separate domain to host the files. Turns out you can inject tags at the top of the iframe content and they'll be obeyed even if subsequent untrusted JavaScript tries to manipulate them.

Was this article helpful?

Sign in to highlight and annotate this article

AI
Ask AI about this article
Powered by Eigenvector · full article context loaded
Ready

Conversation starters

Ask anything about this article…

Daily AI Digest

Get the top 5 AI stories delivered to your inbox every morning.

More about

claudeversionpolicy

Knowledge Map

Knowledge Map
TopicsEntitiesSource
Can JavaScr…claudeversionpolicyresearchSimon Willi…

Connected Articles — Knowledge Graph

This article is connected to other articles through shared AI topics and tags.

Knowledge Graph100 articles · 207 connections
Scroll to zoom · drag to pan · click to open

Discussion

Sign in to join the discussion

No comments yet — be the first to share your thoughts!

More in Models