Clickjacking protection (frame-ancestors and X-Frame-Options)

How to stop other sites from loading your pages in an invisible frame, with CSP frame-ancestors or X-Frame-Options.

What AuditX checks

The scan checks whether your page may be framed by other sites: a Content-Security-Policy frame-ancestors directive, or an X-Frame-Options header set to DENY or SAMEORIGIN. Only the header counts: browsers ignore frame-ancestors in a meta tag. A frame-ancestors * that lets every site frame the page counts as no protection.

Why it matters

In a clickjacking attack, another site loads your page in a transparent frame on top of its own content. A visitor thinks they click the other site, but the click lands on your page: a buy button, a settings change, a like.

Telling the browser who may frame your page stops this outright.

How to fix it

  1. Add frame-ancestors 'self' to your Content-Security-Policy, or frame-ancestors 'none' if your pages are never framed at all.
  2. For older browsers, also send X-Frame-Options: SAMEORIGIN.
  3. If a partner really needs to embed your page, name that origin in frame-ancestors. X-Frame-Options ALLOW-FROM is obsolete and ignored by current browsers.
Content-Security-Policy: frame-ancestors 'self'
X-Frame-Options: SAMEORIGIN

Does your site pass this check? A free scan runs it with every other check and shows the result in about a minute.

Scan my site

Sources

Related checks

Last reviewed 2026-11-13.