Clickjacking protection (frame-ancestors / X-Frame-Options)
type: TechArticle
description: Tell browsers who is allowed to embed your pages in an iframe. Use CSP frame-ancestors. X-Frame-Options is the legacy fallback.
language: en
is part of: Web Specification Studio
author: Web Specification Studio
publisher: Web Specification Studio
license: https://creativecommons.org/licenses/by/4.0/
date modified: 2026-05-29T09:13:20.000Z
citation: OWASP — Clickjacking Defense Cheat Sheet
  type: CreativeWork
  publisher: OWASP
citation: MDN — CSP: frame-ancestors
  type: CreativeWork
  publisher: MDN
citation: MDN — X-Frame-Options
  type: CreativeWork
  publisher: MDN

Web Specification Studio
type: WebSite

Web Specification Studio
type: Organization

breadcrumb
type: BreadcrumbList
item list element: Home
  type: ListItem
  position: 1
  item: https://webspecification.com/
item list element: Spec
  type: ListItem
  position: 2
  item: https://webspecification.com/spec/
item list element: Security
  type: ListItem
  position: 3
  item: https://webspecification.com/spec/security/
item list element: Clickjacking protection (frame-ancestors / X-Frame-Options)
  type: ListItem
  position: 4
  item: https://webspecification.com/spec/security/frame-ancestors/