Skip to content
Skillpedia
Security75k · #3091

x-frame-options

What it does

This skill checks whether a site blocks other websites from embedding its pages in frames. It is for developers and security staff protecting sites where users log in or take actions.

When to use it

  • ✓When a site with logins or payments has no framing protection header.
  • ✓When a security scan reports a clickjacking risk.
  • ✓When a site should be embedded only on its own domain.

Skill link

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/x-frame-options/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/x-frame-options/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“A security scan says my login page can be put inside another site's frame. How do I block that?”

5 new skills a week. 1 minute to read.

How it works

The agent adds a header that stops other sites from framing the pages, or limits framing to the same domain. It can also suggest the newer CSP frame-ancestors setting.

Technical content (original SKILL.md)

Original text by the author, straight from 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: DENY to prevent all framing, or SAMEORIGIN to allow framing only from your own domain
  • ALLOWFROM is obsolete and unsupported in modern browsers — use CSP frame-ancestors instead
  • 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

FAQ

What is clickjacking?

It is an attack where a hidden frame lets a malicious site trick users into clicking buttons they cannot see.

What is the difference between DENY and SAMEORIGIN?

DENY blocks all framing, while SAMEORIGIN allows framing only from your own domain.

Is ALLOWFROM still supported?

No. The skill says it is obsolete and unsupported in modern browsers.

Details

Original description by the author

Use when reviewing HTTP response headers for clickjacking protection on any web application with authenticated user actions.

repo: thedaviddias/Front-End-Checklist

Popularity

GitHub stars
75k
Ranking position
#3091
License
MIT
Updated
10/31/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills