Platform

Platform overview How it works Authorization testing Evidence & reports Private scanning Integrations

Solutions

Security agencies Product teams Regulated industries Partner programme

Learn

Blog Knowledge hub Compare

Resources

Pricing Documentation Help centre FAQ Security & data What we haven’t proved

Company

About Contact Careers Sign in to the platform Start a $199 pilot →

Home / Knowledge hub / X-Frame-Options

Knowledge hub

X-Frame-Options

A header that stops other sites from placing your page inside a frame.

Illustration explaining X-Frame-Options

What it means

X-Frame-Options is an HTTP response header that tells the browser whether your page may be shown inside a frame, iframe, embed or object on another page. The two values in use are DENY, which blocks all framing, and SAMEORIGIN, which allows only your own site. It applies to the page that sends it, so each response you care about needs it.

It exists to stop [[clickjacking]]: an attacker loads your page invisibly inside theirs and tricks a visitor into clicking a real button. RFC 7034 describes it. An older ALLOW-FROM value is obsolete and modern browsers ignore it.

Why it matters

A page that can be framed can be driven by someone else. A signed-in visitor can be nudged into approving a payment, changing an email address or granting access, while believing they are clicking on the attacker's page. The action is genuine, so your logs show an ordinary request.

The header costs one line of server configuration. Security questionnaires and scanners ask for it, and its absence on a sensitive page is an easy finding to raise. It is not the whole answer today: the frame-ancestors directive of a content security policy is the modern control and takes priority where browsers support it.

How it shows up

You meet it in web server, proxy and framework settings, often added by a default security middleware. Check it on the pages that matter: sign-in, settings, payments and anything with a confirm button. Check API and error responses too, because a missing header on a login error page is common.

Typical mistakes are setting it only on the home page, setting it on one server behind a load balancer and not the others, using ALLOW-FROM and believing it works, and sending two different values so the browser ignores both. If you do need to be embedded by a partner, use frame-ancestors with that partner's origin.

Questions people ask

X-Frame-Options, answered

Is X-Frame-Options still needed if I have frame-ancestors?

Where browsers support frame-ancestors, it takes priority. Many teams still send both so that older clients are covered. The two should say the same thing.

What is the difference between DENY and SAMEORIGIN?

DENY stops all framing, even by your own pages. SAMEORIGIN allows framing by pages on the same origin. Use DENY unless you frame your own pages.

Can I set X-Frame-Options in a meta tag?

No. It only works as an HTTP header. A meta tag with the same name is ignored, so it has to come from the server, proxy or CDN.

Does this header stop cross-site request forgery?

No. It stops your page being displayed in a frame. Cross-site request forgery needs a different defence, usually tokens and cookie settings.

How do we test for it?

Request your key pages and read the response headers. Then try framing a page from another origin and see whether the browser refuses. Check every environment, as staging often differs from production.

Cyberlop mark

Can someone else frame your confirm button?

We check the pages that matter for framing and other missing protections, and we only report what we could actually exploit. Ask us to run it on one of your applications.

Or start with a $199 pilot on one application: thirty days, success criteria agreed before day one, credited against the annual if you convert.