CSP アロウリスト実験:サンドボックス環境でのエラー処理と許可ドメイン追加機能
本文の状態
日本語全文を表示中
詳細モードで約1分の本文を読めます。
同じ出来事の情報源
この情報源を基点に整理
Simon Willison Blog
Simon Willison氏が開発したツールは、CSP(コンテンツセキュリティポリシー)で保護されたサンドボックスiframe内でアプリを動作させつつ、fetch()エラーを親ウィンドウへ転送し、ユーザーに許可リストへのドメイン追加を促す実験です。
Source Article
元記事を日本語で読む
本文に関係しない購読案内、埋め込み通知、サイト内プロモーションは除いています。
ツール: CSP Allow-list Experiment
これは、CSP で保護されたサンドボックス化された iframe 内でアプリを読み込み(以前のノート参照)、カスタムの fetch() を使用して CSP エラーをインターセプトし、親ウィンドウへ転送する実験です。その後、ユーザーにそのドメインを許可リストに追加するよう促し、ページを更新することができます。
右側のパネルには、CSP ヘッダー default-src 'none'; script-src 'unsafe-inline'; style-s... のデフォルト設定で表示されるプレビューと、「Sandbox fetch test」という見出しが表示されています。また、tools.simonwillison.net からのモーダルダイアログが重ねられており、内容は「サンドボックスは https://api.inaturalist.org への接続を試みました。このオリジンを CSP connect-src の許可リストに追加してページを更新しますか?」です。チェックボックス「tools.simonwillison.net に再度プロンプトを表示しない」は未選択で、「キャンセル」と「OK」ボタンがあります。その下には「サンドボックスからのメッセージ」が表示され、fetch-catch により https://api.inaturalist.org/v1/observations?per... connect-src · https://api.inaturalist.org がブロックされたことが示されています。左下には「許可された fetch() オリジン」とあり、入力フィールドに https://api.github.com が含まれており、「追加」ボタンとタグ https://api.github.com x が表示されています。
原文を表示
Tool: CSP Allow-list Experiment
An experiment that shows that you can load an app in a CSP-protected sandboxed iframe (see previous note) 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.
. Right panel shows Preview with CSP header default-src 'none'; script-src 'unsafe-inline'; style-s... and heading "Sandbox fetch test". A modal dialog from tools.simonwillison.net is overlaid reading: "The sandbox tried to connect to: https://api.inaturalist.org Add this origin to the CSP connect-src allow-list and refresh the page?" with an unchecked checkbox "Don't allow tools.simonwillison.net to prompt you again" and Cancel and OK buttons. Below is "Messages from sandbox" showing fetch-catch blocked https://api.inaturalist.org/v1/observations?per... connect-src · https://api.inaturalist.org. At the bottom left is "Allowed fetch() origins" with an input field containing https://api.github.com, an Add button, and a tag https://api.github.com x." src="https://static.simonwillison.net/static/2026/csp-allow.jpg" />
Tags: content-security-policy, iframes, security
関連記事
今日のまとめ
AIデイリーブリーフで今日の重要ニュースをまとめ読み