Arviser

Missing anti-clickjacking header (X-Frame-Options): is it real, how to fix it, what to tell the customer

Facts

Scanner finding
KB-F-0008 · Web and API
Also known as
Missing Anti-clickjacking Header, Multiple X-Frame-Options Header Entries, X-Frame-Options Defined via META (Non-compliant with Spec), X-Frame-Options Setting Malformed, Web Application Potentially Vulnerable to Clickjacking, Missing or Permissive Content-Security-Policy frame-ancestors HTTP Response Header, Missing or Permissive X-Frame-Options HTTP Response Header, Frameable response (potential Clickjacking), Content security policy: allows clickjacking
Tool IDs
ZAP 10020 "Anti-clickjacking Header": 10020-1 "Missing Anti-clickjacking Header", 10020-2 "Multiple X-Frame-Options Header Entries", 10020-3 "X-Frame-Options Defined via META (Non-compliant with Spec)", 10020-4 "X-Frame-Options Setting Malformed"; related ZAP 10055-13 "CSP: Failure to Define Directive with No Fallback"; Nessus 85582 "Web Application Potentially Vulnerable to Clickjacking", 50344 "Missing or Permissive Content-Security-Policy frame-ancestors HTTP Response Header", 50345 "Missing or Permissive X-Frame-Options HTTP Response Header"; nuclei http-missing-security-headers, matcher x-frame-options; Burp 0x005009a0 "Frameable response (potential Clickjacking)" and 0x00200507 "Content security policy: allows clickjacking"
Standard
CWE-1021, as ZAP cites it; the HTML Standard for X-Frame-Options, which supersedes RFC 7034; CSP Level 3 for frame-ancestors
Lab
scanner-findings-b3, runs 13 to 15: nginx 1.30.8, Apache httpd 2.4.71, Express 5.3.0, helmet 8.3.0, images pinned by digest
Test
tests/frame-options.sh url..., answers FINDING or COULD NOT TELL
Next review
2027-06-01

Short answer

The finding (ZAP 10020; Nessus 85582, 50344, 50345; nuclei http-missing-security-headers; Burp 0x005009a0, 0x00200507) says an HTML page did not limit which sites may frame it. It is real unless the page sends a frame-ancestors that limits framing ('self', 'none' or named sites, not * or https:) or, without frame-ancestors, exactly one X-Frame-Options value, DENY or SAMEORIGIN (repeats count as one; several values with DENY, SAMEORIGIN or ALLOWALL block every frame). A wildcard on a shared domain (https://*.hosting.example) lets every site there frame the page.

1. What the scanner saw

2. Is it real on your system?

curl -sS -D - -o /dev/null https://app.example.com/ | grep -iE '^(HTTP/|x-frame-options|content-security-policy)'

Run it on the URL from the report and on one page behind sign-in, with your session cookie (-b 'session=...'). The finding is real when the output shows any of these, read the way the HTML Standard and CSP 3 tell browsers to read it:

On our nginx with defaults the command printed HTTP/1.1 200 OK and nothing else. With the headers added it also printed X-Frame-Options: SAMEORIGIN and Content-Security-Policy: frame-ancestors 'self'.

What a header in the output does not show, each seen in our lab:

3. How serious it is for you

Our view: usually Low, sometimes Medium, and cheap to address. Clickjacking needs three things at once: a page where a click or two completes an action, the visitor signed in inside the frame, and a page of the attacker's that the visitor opens. Settings toggles, "delete", "approve", "connect account" and OAuth consent screens are the pages that matter.

Check your session cookie. MDN says a Lax cookie is not sent for "navigations inside <iframe> elements" from another site (MDN Set-Cookie), and Strict is narrower. In that case the framed page shows the visitor signed out. A session cookie with SameSite=None, which embedded apps and some single sign-on setups need, keeps the full risk, and so do actions that work without a session. MDN: "Some browsers use Lax as the default value if SameSite is not specified"; others do not.

Marketing pages, documentation and public pages with no actions carry little risk. Customers still ask for the header on every page.

Accepted risk is reasonable for a page built to be embedded (a widget, a booking form, a page inside a partner's portal), with frame-ancestors naming the sites that embed it.

4. Fix it on your platform

Each section quotes the vendor's documentation. Warnings marked "our warning" are ours. Lines marked "lab-tested" ran in our lab exactly as printed.

Our warnings, for every platform:

nginx (lab-tested on 1.30.8)

nginx documentation (add_header):

Adds the specified field to a response header provided that the response code equals 200, 201 (1.3.10), 204, 206, 301, 302, 303, 304, 307 (1.1.16, 1.0.13), or 308 (1.13.0).

These directives are inherited from the previous configuration level if and only if there are no add_header directives defined on the current level.

If the always parameter is specified (1.7.5), the header field will be added regardless of the response code.

Lab-tested, in the server block:

add_header X-Frame-Options "SAMEORIGIN" always;
add_header Content-Security-Policy "frame-ancestors 'self'" always;

For add_header_inherit (nginx 1.29.3 and later) the documentation says: "The merge parameter enables appending values from the previous level to the values defined at the current level." Lab-tested: add_header_inherit merge; in the server block kept both headers on a location with its own add_header. For proxied apps (proxy_hide_header): "The proxy_hide_header directive sets additional fields that will not be passed." Lab-tested: proxy_hide_header X-Frame-Options; next to proxy_pass.

Our warnings:

Apache httpd (lab-tested on 2.4.71)

mod_headers documentation (Header):

The optional condition argument determines which internal table of responses headers this directive will operate against: onsuccess (default, can be omitted) or always.

always is not a superset of onsuccess with respect to existing headers

set: The response header is set, replacing any previous header with this name.

unset: The response header of this name is removed, if it exists.

Lab-tested, in the virtual host:

Header onsuccess unset X-Frame-Options
Header always set X-Frame-Options "SAMEORIGIN"
Header always set Content-Security-Policy "frame-ancestors 'self'"

Our warnings:

Express and Node.js (lab-tested on Express 5.3.0, helmet 8.3.0)

helmet README (helmet): app.use(helmet()); "This will set 13 HTTP response headers in your app." Among them the default X-Frame-Options: SAMEORIGIN and this default policy:

default-src 'self'; base-uri 'self'; font-src 'self' https: data:; form-action 'self'; frame-ancestors 'self'; img-src 'self' data:; object-src 'none'; script-src 'self'; script-src-attr 'none'; style-src 'self' https: 'unsafe-inline'; upgrade-insecure-requests

Lab-tested (it needs the helmet package; the README imports it with import helmet from "helmet";, our CommonJS app used require('helmet')):

app.use(helmet());

The raw header from our helmet() target carried that policy and X-Frame-Options: SAMEORIGIN. The README: "These directives are merged into a default policy". Lab-tested, to let one partner frame the app:

app.use(
  helmet({
    contentSecurityPolicy: {
      directives: { frameAncestors: ["'self'", 'https://partner.example.test'] },
    },
  }),
);

Our warnings: helmet() changes more than framing. Try it on staging first.

The README also gives each header as standalone middleware, for example "You can use this as standalone middleware with app.use(helmet.xFrameOptions())" (from the README, not run by us). With helmet({ contentSecurityPolicy: false }), which the README gives to disable the CSP header, the response from our app carried X-Frame-Options: SAMEORIGIN and no frame-ancestors.

Django and Rails (from documentation, not run by us)

Our warning: a finding on either usually means the middleware or default header was removed, a view was exempted, or a proxy in front drops the header.

IIS (from documentation, not run by us)

Microsoft's sample (IIS custom headers): "The following configuration sample sets a custom HTTP header and value", with <add name="X-Custom-Name" value="MyCustomValue" /> under <system.webServer><httpProtocol><customHeaders>. Our warning: put X-Frame-Options and SAMEORIGIN in place of the sample's name and value; if the application sets the header too, remove one source, since we did not check how IIS combines them.

Cloudflare (from documentation, not run by us)

Cloudflare (response header modification): "Add operations append a new header without removing existing headers of the same name, while Set operations replace all existing headers of that name." Our warning: Set for X-Frame-Options avoids a second copy; Set for Content-Security-Policy replaces the origin's whole policy, and Add makes a second policy.

AWS (from documentation, not run by us)

Our warning: with override "No", an origin that sends its own value keeps it.

Vercel and Netlify (from documentation, not run by us)

Our warning: both examples use DENY, which stops your own frames; use SAMEORIGIN if you frame your own pages.

5. What to tell the customer

Example wording, adapt to what is true.

Headers added:

Thank you for the report. Pages on app.example.com now send Content-Security-Policy: frame-ancestors 'self' and X-Frame-Options: SAMEORIGIN. Attached are the response headers for and for a signed-in page, captured on .

Not a page:

The URL in the report returns JSON to our own front end (or: a redirect to ), not a page that a browser shows in a frame. The headers of are attached, .

Embedded on purpose:

is built to be embedded by . It sends frame-ancestors 'self' https://partner.example.com. We review the list on .

Evidence to attach: curl -sS -D - output for the URLs in the report and for one signed-in page, with the date.

6. Test: finding or could not tell

Our script frame-options.sh, run as sh frame-options.sh url..., requests each listed URL once and reads the headers the way the HTML Standard and CSP 3 tell a browser to. It answers only two things:

There is no exit 0. The rule was written before the record runs.

7. What we ran

Record runs 13 to 15, 2026-11-29: nginx 1.30.8, Apache httpd 2.4.71, Express 5.3.0, helmet 8.3.0, Node.js 22, images pinned by digest. In each run the 61 cases gave the same answer on the GNU and the BusyBox client, and with curl, awk, grep, sed, tail or mktemp removed from PATH the test answered COULD NOT TELL on both. "Could not tell" in the table means the test printed what the response carried and no finding.

Target Config Our test ZAP 2.17.0 baseline nuclei 3.11.1
nginx 80 defaults FINDING: no frame header 10020-1 x-frame-options
nginx 8080 the printed snippet could not tell; carried frame-ancestors 'self', SAMEORIGIN no 10020 none
nginx 8081 headers in server, /app/ with its own add_header FINDING with /app/ listed; could not tell with / alone run 13: 10020-1 on /app/; runs 14 and 15: none none (requests / only)
nginx 8082 same plus add_header_inherit merge could not tell; both headers carried on / and /app/ not run not run
nginx 8083 X-Frame-Options: DENY and frame-ancestors * FINDING no 10020; 10055-13 names frame-ancestors none
nginx 8084 default-src 'self' only FINDING 10020-1, 10055-13 not run
nginx 8085 ALLOW-FROM FINDING 10020-4 none
nginx 8086 / 8087 proxy to an app with XFO, nginx adds one / plus proxy_hide_header could not tell, two equal lines (note) / could not tell, one line 8086: 10020-2 not run
nginx 8088 XFO and frame-ancestors in meta tags only FINDING 10020-1 (on /app/ too except in run 14), 10020-3 x-frame-options
nginx 8089 frame-ancestors 'none' in report-only FINDING not run not run
nginx 8090 frame-ancestors *; frame-ancestors 'none' FINDING (first directive counts) no 10020; 10055-13 names frame-ancestors not run
nginx 8091 lower-case header names, FRAME-ANCESTORS 'SELF', x-frame-options with spaces could not tell; values printed not run not run
nginx 8092 / 8093 two CSP lines / two comma-joined policies, one without a wildcard could not tell not run not run
nginx 8094 X-Frame-Options: SAMEORIGIN, DENY in one line could not tell, with the note that browsers block every frame no 10020 none
nginx 8095 frame-ancestors https: FINDING not run not run
nginx 8096 frame-ancestors self (unquoted) could not tell, with a note that it names a host called self not run not run
nginx 8097 / redirects to /home/, header on the redirect only redirect alone: could not tell (target not listed); with /home/ listed: FINDING runs 13 and 15: 10020-1 under / and /home/; run 14: none x-frame-options on /home/
nginx 8098 http:// redirects to HTTPS 8444, header on the redirect only redirect alone: could not tell; with the HTTPS URL listed: FINDING not run none; see below
nginx 8099 header on 404 pages only 404 URL: could not tell; /: FINDING 10020-1 on / x-frame-options
nginx 8100 proxy adds frame-ancestors 'self', app lists a partner could not tell; prints both policies and the note not run not run
nginx 8101 / 8102 / redirects to itself / /a and /b redirect to each other could not tell: redirects to itself / the redirect chain loops not run not run
nginx 8104 / 8105 frame-ancestors https://*.example.com / *.com could not tell, with the host-wildcard note not run not run
nginx 8106 / 8107 X-Frame-Options: ALLOWALL-X, INVALID / sameorigin and SAMEORIGIN lines FINDING / could not tell (one value after lower-casing) not run not run
raw server 8086 /page redirects to ?lang=en, that page has no header redirect alone: could not tell; with /page?lang=en listed: FINDING not run not run
nginx 8108 / 8109 / 8110 frame-ancestors 'self' chrome-extension: / chrome-extension://* / wss: could not tell / could not tell / FINDING not run not run
nginx 8443 / 8444 HTTPS with the snippet / without a header could not tell / FINDING not run not run
raw server 8085 X-Frame-Options: DENY, CSP folded over two lines with frame-ancestors * FINDING (lines joined) not run not run
http:// to 8443, https:// to 80, /data.json wrong scheme, wrong scheme, JSON could not tell in all three not run not run
Apache, defaults static page, proxied app with XFO FINDING on the static page not run not run
Apache, Header always set only static / proxied app could not tell / could not tell, two equal XFO lines (note) 10020-2 on /app/ not run
Apache, the printed snippet static and proxied app could not tell; one XFO, frame-ancestors 'self' not run not run
Apache 8081 / 8082 app with its own CSP; always set / set could not tell; two policies / one policy, the app's gone not run not run
Express defaults / helmet() / XFO only / partner listed FINDING / could not tell / could not tell / could not tell defaults: 10020-1 on /app/ in all three runs, on / in runs 13 and 14 helmet(): none
Express sign-in /account alone / with /login / with COOKIE / COOKIE without = could not tell / could not tell (stated limit) / FINDING / could not tell not run not run
a port that never answers, an SSH port, an unknown host, an ftp:// URL, no URL negative cases could not tell in all five not run not run

The runs were done by Claude Opus 5.5 (agent) on an internal Docker network with no outside access. Expected results were written before each round of runs and are in the lab's results folder with the raw outputs, image digests and file hashes. Runs 1 to 3 used an earlier version of the test with a pass answer; an independent check rejected that, and they are kept as history, with run 4 (loop message missing), an interrupted run 5, runs 7 to 9, which counted repeated X-Frame-Options values as a finding, and runs 10 to 12, which counted every bare scheme in frame-ancestors as open to any site.

Surprises kept on record:

Sources

Primary records first. Record identifiers link from the facts box.

Scanner rules and tool documentation

Standards and specifications

Vendor documentation and statements

Our lab

Corrections

No corrections.

Report an error to contact@arviser.com.

How this page was made: Claude Opus 5.5, an AI model, built and ran the lab and wrote this page from the sources listed. Separate AI agents checked the claims and the lab test in four rounds; the page and the test's rule were corrected after the first three, and the fourth, on 1 December 2026, found nothing that had to be fixed. Vadim Nareyko approved the family template and the sample pages on 26 November 2026, from a summary in Russian. This page was not reviewed by Vadim Nareyko. On 28 November 2026 Vadim Nareyko decided that new pages in the family are published after the linters and an independent check, without that review.

Text and data on this page: CC BY 4.0. Code in our lab: MIT. Quoted third-party material keeps its own terms.

Send written scope or question (Free)