Skip to content
FixSecurityHeadersScan a site

X-Frame-Options explained

Last updated · Reviewed by a CISSP-certified security practitioner

X-Frame-Options: X-Frame-Options (or the modern CSP frame-ancestors) tells browsers whether other sites may put your pages inside an iframe. Recommended value: DENY.

What risk does it prevent?

Attackers can overlay your page invisibly and trick users into clicking buttons (clickjacking) — e.g. changing settings or confirming payments.

What is the safe recommended value?

X-Frame-Options: DENY

What are the gotchas?

  • Use SAMEORIGIN if your own site frames its pages.
  • ALLOW-FROM is obsolete; use CSP frame-ancestors for allow-lists.
  • If CSP frame-ancestors is present, modern browsers ignore X-Frame-Options.

Which compliance controls reference it?

  • OWASP ASVS V14.4.7
  • NIST 800-171 3.13.1
  • CMMC SC.L2-3.13.1

How do I add it on my stack?

Check your site now

Free scan, instant grade, exact fixes for your stack.

Other security headers