Check explainer · v1

Clickjacking protection: X-Frame-Options or frame-ancestors

Automated

Last reviewed

Without a framing policy, any site can load your checkout in a frame and put its own buttons on top. One header stops it.

How this check works

X-Frame-Options — or a frame-ancestors directive inside the CSP — passes the check; a page with neither fails. Either channel proves a framing policy exists; which one you use is a stack decision the rule does not second-guess.

What does a failure look like?

Templates that predate both headers; a CSP written only for script sources with no frame-ancestors; a CDN that strips X-Frame-Options — pages where the clickable surface can be embedded anywhere.

How to fix it, step by step

  1. Send X-Frame-Options: SAMEORIGIN (or a frame-ancestors list) on every response.
  2. Prefer frame-ancestors where a CSP already exists; both together are fine.
  3. Re-run the audit and confirm the representative page reports one of the two.

What does a pass or fail look like?

Good

X-Frame-Options: SAMEORIGIN on every page, with CSP frame-ancestors as the modern companion.

Fail

No X-Frame-Options and no frame-ancestors — any page on the web can frame the site and overlay its buttons.

Frequently asked questions

Is clickjacking protection an SEO issue?

Indirectly: it is graded as hygiene because the failure mode is a compromised page — an overlay that turns user clicks into attacker actions. Search engines see a page whose visible behavior no longer matches its code.

Do I need both X-Frame-Options and frame-ancestors?

No — either satisfies the check, and CSP frame-ancestors is the modern channel. Sending both adds belt-and-braces compatibility for older browsers at no real cost.

Does this break legitimate embedding?

SAMEORIGIN and explicit frame-ancestors lists allow the embeddings you own. If a partner legitimately frames your pages, name their origin in frame-ancestors instead of disabling the protection.

This rule is one of the checks the audit runs. Run the full site audit

Free preview; no account needed.

Visdenda check explainers · one page per published ruleClickjacking protection · v1