x-frame-options
できること
このスキルは、他のウェブサイトがページをフレームに埋め込むことを防いでいるかを確認します。ログインや決済など、利用者が操作するサイトを守る開発者やセキュリティ担当者向けです。
使う場面
- ✓ログインや決済のあるサイトに、フレームの保護ヘッダーがないとき。
- ✓セキュリティスキャンでクリックジャッキングのリスクが報告されたとき。
- ✓サイトが自分のドメインでのみ埋め込まれるべきとき。
スキルのリンク
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/x-frame-options/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“セキュリティスキャンで、私のログインページが他のサイトのフレームに入れられると言われました。それを防ぐにはどうすればよいですか?”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、他のサイトがページをフレームに入れることを止めるか、フレームを同じドメインに限定するヘッダーを追加します。新しいCSPのframe-ancestorsの設定も提案できます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Set an X-Frame-Options header
Without framing protection, an attacker can embed your banking login page in a transparent iframe on a malicious site and trick users into clicking buttons they cannot see — transferring money, changing settings, or leaking credentials.
Quick Reference
- Use
X-Frame-Options: DENYto prevent all framing, orSAMEORIGINto allow framing only from your own domain ALLOWFROMis obsolete and unsupported in modern browsers — use CSPframe-ancestorsinstead- The modern equivalent is
Content-Security-Policy: frame-ancestors 'none'— prefer CSP for new sites - Both headers can coexist: X-Frame-Options for older browsers, frame-ancestors for modern ones
- Clickjacking attacks trick users into clicking invisible iframe buttons — DENY eliminates this entirely
Check
Check whether the server sends an X-Frame-Options header (DENY or SAMEORIGIN) or a Content-Security-Policy header with frame-ancestors directive to prevent clickjacking.
Fix
Add X-Frame-Options: DENY to all responses if the site does not need to be embedded anywhere. If legitimate framing is needed on the same origin, use SAMEORIGIN. For fine-grained control, use CSP frame-ancestors instead.
Explain
Explain what a clickjacking attack is, how X-Frame-Options and CSP frame-ancestors prevent it, and the difference between DENY and SAMEORIGIN values.
Code Review
Review server config, headers, forms, and integration points related to Set an X-Frame-Options header. Flag exact responses, cookies, or browser behaviors that violate the rule, and verify them against the effective production-like response.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/security/x-frame-options
よくある質問
クリックジャッキングとは何ですか?
悪意のあるサイトが、見えない隠しフレームを使って、利用者に見えないボタンをクリックさせる攻撃です。
DENYとSAMEORIGINの違いは何ですか?
DENYはすべてのフレームを禁止するのに対し、SAMEORIGINは自分のドメインからのフレームだけを許可します。
ALLOW-FROMはまだ使えますか?
いいえ。このスキルによると、古くなっていて、最新のブラウザーでは対応していません。
詳細
作者による元の説明
Use when reviewing HTTP response headers for clickjacking protection on any web application with authenticated user actions.
人気
- GitHubのスター
- 75k
- ランキング
- #3091
- ライセンス
- MIT
- 更新日
- 2026/10/31
コメント
- …
このリポジトリの他のスキル
frontendchecklist
75kコマンドラインツールを使って、フロントエンドのコードとライブページを、アクセシビリティ、速度、SEO、セキュリティに関する380以上のルールと照らし合わせて確認します。
frontend-checklist-global
75kフロントエンドのプロジェクトを、386のFront-End Checklistのルールすべてと照らし合わせて監査し、見つかった問題ごとに具体的な修正方法を示します。
404-page
75k見つからないページの画面に役立つリンクがあり、本物の404ステータスを返すかを確認し、迷った訪問者が目的のページを見つけられるようにします。
about-page
75kサイトの運営者が誰かを説明する、分かりやすいAboutページがあるかを確認し、訪問者と検索エンジンからの信頼を高めます。
似ているスキル
reverse-engineer-anything
422kREAツールを使って、出荷済みのアプリやパッケージの中身を調べ、機能の説明、版の比較、再構築の手順をエージェントが支援します。
1password
394k1Password CLIをセットアップし、サインインして、秘密情報の値を会話に表示せずに読み取ったり注入したりするようエージェントを支援します。
healthcheck
394kOpenClawを動かすコンピューターやサーバーを、SSH、ファイアウォール、更新、バックアップなどのセキュリティリスクについて監査し、安全な修正案を提案するようエージェントを支援します。