BreachHunter
Pricing Blog Log inSign up
● thermal huntscan engines onlineassessment only — no exploits
  1. Home
  2. Blog
  3. Clickjacking and X-Frame-Options: How Framing Attacks Work

Guides · ← All guides

Clickjacking and X-Frame-Options: How Framing Attacks Work

Published: November 14, 2026 · Last reviewed: November 14, 2026 · 7 min read

By the Ingenious AI team

The short answer: Clickjacking is an attack where your real page is loaded inside an invisible iframe on an attacker's page, positioned so the victim's clicks land on your buttons — “Delete account”, “Confirm transfer” — while they think they are clicking something harmless. X-Frame-Options: DENY tells browsers never to render your pages inside a frame on another site, which kills the technique outright. BreachHunter rates its absence MEDIUM (3 points).

Run a free BreachHunter assessment on your site →

Clickjacking is the quietest attack in the web-audit phase: nothing on your server is compromised, no code is injected, and your application logs show a legitimate user performing a legitimate action. The deception happens entirely in the victim's browser, using your own interface as the weapon.

This guide walks through how a framing attack is assembled, why the scanner's fix offers two equivalent options (the header or CSP frame-ancestors), and the one legitimate case — embedding your own content — where SAMEORIGIN or an allow-list is the right variant instead of DENY.

How is a clickjacking attack assembled?

The attacker builds a page with a tempting surface — a fake play button, a prize claim — and layers your page over it in an iframe styled with opacity: 0, aligned so your high-value button sits exactly under their decoy. The victim, already logged into your site, clicks the visible decoy; the click passes to the invisible button beneath. Their session, their authority, the attacker's chosen action.

The preconditions are why assessments care: the victim must be logged in, and your page must be frameable. You cannot control the first. The second is entirely yours, and it is a single response header. Pages with no state-changing actions are low-stakes; settings, billing and admin pages are where framing protection earns its rating — see also how this finding orders against others in which findings to fix first.

Header or frame-ancestors: which fix should you send?

The scanner's fix text offers both: “Send X-Frame-Options: DENY (or use frame-ancestors in your CSP).” X-Frame-Options is the older, simpler header: DENY blocks all framing, SAMEORIGIN permits your own origin. CSP's frame-ancestors 'none' or 'self' directive is its modern successor and adds per-origin allow-listing for partners who legitimately embed you.

Sending both is safe when they agree — browsers enforce the stricter result — and it covers older clients that ignore CSP. What fails an assessment is neither. If you run a widget others embed, DENY is wrong for you: use frame-ancestors with your partner origins enumerated, and document why, so the next audit reads it as a decision rather than a gap. The CSP rollout method in our CSP guide covers the report-only way to get there.

Worked example: northloopfitness.example

Northloop Fitness runs class bookings and membership billing on one site. Its scan found framing protection missing site-wide — including the “cancel membership” and saved-card pages. To show why the finding mattered, the report's reviewer framed the live billing page inside a local test page in under five minutes: the account page rendered perfectly inside the foreign frame, one CSS opacity rule away from a working clickjacking demo.

curl -I https://northloopfitness.example/account/billing
HTTP/2 200
content-security-policy: (absent)
x-frame-options: (absent)  <- page is frameable by any origin

Northloop had no legitimate embedding use case, so the fix was the strict one: X-Frame-Options: DENY plus frame-ancestors 'none' in the CSP it added the same sprint. The retest confirmed both, the 3-point finding closed, and the five-minute framing demo stopped working — the browser refused to render the page in the foreign frame at all.

The five actions to take

Closing the framing gap in one change window:

  1. List any legitimate embedding of your pages (partner widgets, dashboards) — that list decides DENY versus an allow-list.
  2. Send X-Frame-Options: DENY, or SAMEORIGIN if your own pages frame each other.
  3. Mirror the rule as frame-ancestors in your Content-Security-Policy for modern browsers.
  4. Test by framing your login and billing pages from a page on another origin: the browser must refuse to render them.
  5. Re-scan and confirm the finding closed on every template, not just the homepage.

Run a free BreachHunter assessment on your site →

Frequently asked questions

What is clickjacking in simple terms?

An attacker hides your real page inside an invisible frame on their page and tricks a logged-in user into clicking your buttons while aiming at a decoy. The action executes with the victim's own session, so your logs show nothing suspicious.

Is X-Frame-Options still needed if I have a CSP?

frame-ancestors in CSP is the modern equivalent and suffices for current browsers. Sending both, consistently, is the belt-and-braces pattern assessments accept and older clients still benefit from.

We embed our own booking widget on partner sites. Is DENY wrong for us?

Yes — DENY would break your partners. Use frame-ancestors with the partner origins listed, or X-Frame-Options with an ALLOW-FROM successor via CSP. The finding closes when framing is deliberately restricted, not necessarily forbidden.

Which pages matter most for clickjacking?

Any page where one click changes state: account settings, billing, transfers, admin actions, OAuth consent screens. A frameable read-only blog post is a much smaller risk than a frameable “confirm payment” page.

How does the scanner detect missing framing protection?

The web audit reads your response headers: if neither X-Frame-Options nor a CSP frame-ancestors directive is present, it files the MEDIUM finding with the standard fix text.

Testing the fix yourself, in the browser you already have

Verification takes two minutes and needs no tooling beyond a browser. First, read the headers: curl -sI https://yoursite.example/login should show either X-Frame-Options or a CSP with frame-ancestors — on the login and checkout pages specifically, not just the homepage, since header rules are often set per location.

Second, try to frame yourself. Put a test page on another origin you control — a free static host is fine — with an iframe pointing at your login page, and open it. The framed page should refuse to render, and the browser console will name the header that stopped it. That console message is the finding, closed, in the browser's own words.

Sources

The primary sources behind this guide — the documents we check our own work against:

  • RFC 7034 (2013) — the X-Frame-Options header specification.
  • W3C Content Security Policy Level 3 (2023) — the frame-ancestors directive that supersedes it.
Share this: X · Facebook · LinkedIn · WhatsApp

Related guides

  • Website Security Test: What It Checks, What It Misses, and How to Read Yours · 9 min read
  • Website Security Cheat Sheet: Headers, TLS, Cookies and Exposed Files · 7 min read
  • What a Website Security Assessment Actually Tests · 10 min read
  • TLS/SSL Basics: What Your Certificate Says About Your Site · 8 min read
  • Common Website Misconfigurations (and How to Fix Them) · 11 min read
  • Reading Your First Pentest Report: From Score to Action · 9 min read
  • Deleted ≠ Gone: What the Wayback Machine Keeps After You Delete Your Secrets · 9 min read
  • SQL Injection in Plain English: How One Login Box Can Read Your Database · 9 min read
  • What Does a Website Security Scan Check? · 8 min read
  • Exposed .git Directory: What It Leaks and How to Check · 7 min read
  • Security Headers Missing? What Each Header Stops · 7 min read
  • How Much Does a Penetration Test Cost in 2026? · 7 min read
  • Website Security Checklist for Small Teams (60-second self-check) · 6 min read
  • Reading Your Scan Results: Which Findings Fix First? · 7 min read
  • Content-Security-Policy Missing: What CSP Does and How to Add It Safely · 8 min read
  • HSTS Missing: What Strict-Transport-Security Prevents · 7 min read
  • Cookie Flags Explained: Secure, HttpOnly and SameSite · 8 min read
  • Exposed .env File: What Leaks, What Attackers Do Next, What You Do First · 8 min read
  • Directory Listing Enabled: What It Shows Attackers and How to Disable It · 7 min read
  • Mixed Content: Why Your HTTPS Page Still Loads Insecure Resources · 7 min read
  • Expired SSL Certificate: What Breaks, Why Renewal Fails, and How to Catch It Early · 7 min read
  • TLS 1.0 and 1.1 Still Enabled: Why Old Protocols Show Up as a Finding · 7 min read
  • Open Ports on a Web Server: Which Ones Should Never Face the Internet · 8 min read
  • No SPF or DMARC Record: How Missing Email Auth Exposes Your Website · 7 min read
  • Subdomain Takeover: How a Dangling DNS Record Lets Attackers Claim Your Name · 7 min read
  • Forgotten Subdomains: The Staging Site You Forgot Is Still Public · 7 min read
  • WordPress Security Scan: The Exposures an Assessment Finds on WordPress Sites · 8 min read
  • Exposed Backup Files: .bak, .old and .zip Files Sitting in Your Web Root · 7 min read
  • phpinfo() in Production: The Diagnostic Page That Maps Your Server for Attackers · 7 min read
  • Server Version Banners: Why Your Headers Point Attackers to the Right Exploit · 7 min read
  • End-of-Life Software: Running a Server Stack Nobody Patches Anymore · 7 min read
  • CORS Misconfiguration: When Cross-Origin Sharing Opens Your Data to Any Site · 7 min read
  • Open Redirect Vulnerability: How Your Own Domain Sends Visitors to a Phishing Page · 7 min read
  • Dangerous HTTP Methods: What TRACE, PUT and DELETE Should Never Answer · 7 min read
  • Host Header Injection: Poisoned Reset Links and Cache Attacks Explained · 7 min read
  • What Is security.txt? The Small File That Lets Researchers Reach You · 6 min read
  • Admin Panel Exposed to the Internet: What an Assessment Flags and Why · 7 min read
  • phpMyAdmin Exposed: Why This Database Door Is a Prime Brute-Force Target · 7 min read
  • Spring Boot Actuator Exposed: Environment Dumps, Heap Leaks and Shutdown Endpoints · 7 min read
  • Debug Console in Production: The Finding That Can Become Code Execution · 7 min read
  • Exposed AWS Credentials File: The /.aws/credentials Finding, Explained · 7 min read
  • Referrer-Policy and Permissions-Policy: The Two Quiet Headers You Are Probably Missing · 6 min read
  • Exposed package.json: Your Dependency List Is a Recon Gift · 6 min read
  • DNS Zone Transfer Open (AXFR): Handing Out Your Entire DNS Map · 6 min read
  • Certificate Name Mismatch: Why the Cert Does Not Match Your Domain · 6 min read
  • Website Security Assessments for Agencies: Checking Every Client Site Without a Security Team · 8 min read
  • SaaS Security Questionnaires: What Buyers Check About Your Website First · 8 min read
  • Ecommerce Website Security: The Exposures That Put Your Checkout at Risk · 8 min read
  • Small Business Website Security: The Checks That Matter at Your Size · 7 min read
  • How to Prepare for a Website Security Assessment (and Read the Report Calmly) · 7 min read
  • Vulnerability Severity Explained: What Critical, High, Medium and Low Actually Mean · 7 min read
  • Retest After Fixes: How to Prove a Security Finding Is Actually Closed · 7 min read
  • Security Assessment vs Vulnerability Scan vs Pentest: What Is the Difference? · 7 min read
  • How Long Does a Website Security Scan Take? · 6 min read
  • Website Security Drift: Why Last Month's Clean Scan Is Already Out of Date · 7 min read
  • WordPress Site Keeps Getting Hacked After Cleanup · 8 min read
  • Google Blacklist Removal: Getting the Red Warning Off Your Site · 8 min read
  • VirusTotal Flagged My Site: How to Clear a False Positive · 8 min read

Related from the Ingenious AI suite

  • Ingenious AI — the full suite of security and compliance tools
  • DomainGuard — domain impersonation and typosquat defense
  • See BreachHunter pricing →
BreachHunter · by Ingenious AI · read-only security assessment — scan only targets you own or are authorized to test
About · Contact · Blog · vs Intruder · Privacy · Terms · Security · Threats · Nextcloud Check · Verify Evidence · Help · Redeem
More from Ingenious AI:
DisclosureGuard — AI disclosure compliance · Vibe-Code Audit — AI code security scanner · Rogue-Agent Defense — AI agent firewall · ChatBreaker — AI chatbot red-teaming · ModelMinder — AI model deprecation radar · TermsWatch — AI vendor terms monitor · Agent Flight Recorder — tamper-evident agent audit trails · Agent Auth Gateway — agent credentials & kill switch · DomainGuard — domain impersonation defense · Agent Passport — Know-Your-Agent registry · AgentGate — agent policy publisher · AgentBlock — AI agent & crawler access control · BoundaryVault — agent log forensics · Agentic Receipts — verifiable agent payment receipts · EvalEgress — eval-to-production exposure scan · HomeShield MCP — home AI server exposure check · WireWatch — payment verification ceremony · ADMT Notice Kit — AI decision notice compliance · DueLadder — human-approved invoice chasing · Agent-Ready Store Audit — can AI agents buy from your store · ContentCraft AI — content operations · AgentReady — agent-readiness checks · AI Audit Exchange — AI audit exchange · CallbackShield — callback & webhook protection · CompanionGuard — AI companion safety guardrails · CRAClock — EU Cyber Resilience Act deadline clock · EInvoice Translator — e-invoice format translator · GEOFixer — geo & local listing fixes · MandateGuard — agent spending mandates · OutcomeMeter — AI outcome measurement · ProvenanceGuard — content provenance checks · ReviewDesk — review response desk · ReviewProof — verified review evidence · TakedownCoop — coordinated phishing takedowns · TrustGate — trust & safety gating · BreachHunter — website penetration testing · All 36 platforms — the Ingenious AI portfolio

We use cookies. Necessary cookies keep the site working. With your permission we also use analytics cookies (to understand usage) and marketing cookies (for ads). Read our privacy policy.

NecessaryRequired for login, security and core features. Always on.
AnalyticsHelps us understand which pages are useful.
MarketingUsed for advertising and measuring ad performance.

    No match. Try “pricing”, “php2shell” or “contact” — or press Esc to close.

    ↑↓ navigate · Enter open · Esc close