Category: Web Exploits
Clickjacking
Clickjacking hides a real page under a decoy. Your click lands on a hidden button.
The hidden button can confirm a payment or permission. Site owners stop it by blocking framing. Send a CSP frame-ancestors directive. Add X-Frame-Options for older browsers.
The click is real, so logs look normal. Malware scanners have nothing to catch.
Updated 2026-10-30
How does clickjacking work?
OWASP calls clickjacking a UI redress attack. Transparent or opaque layers trick you into clicking something else.
For background-tab tricks, see tabnabbing.
- A malicious page frames a real site, hidden from view.
- It shows a decoy button, like Play or Close.
- Your click passes through to the hidden site's button.
- The real site sees a signed-in user approving an action.
How do you prevent clickjacking with CSP frame-ancestors?
Tell browsers which sites may frame your pages. OWASP recommends frame-ancestors 'none' unless you need framing. Use 'self' to allow only your own site. It does not work in a meta tag, per MDN.
# Block all framing
Content-Security-Policy: frame-ancestors 'none'
X-Frame-Options: DENY
# Allow only your own origin
Content-Security-Policy: frame-ancestors 'self'
X-Frame-Options: SAMEORIGINIs X-Frame-Options still needed?
Only as a fallback for older browsers. OWASP says frame-ancestors made X-Frame-Options obsolete. Browsers that enforce frame-ancestors ignore X-Frame-Options. The ALLOW-FROM value no longer works in modern browsers.
How do you test your site for clickjacking?
- Create a local HTML file with an iframe.
- Point the iframe at a sensitive page on your site.
- Open the file in a current browser.
- If the page renders in the frame, it is exposed.
- Repeat for sign-in, settings, and payment pages.
<!doctype html>
<title>Framing test</title>
<iframe src="https://example.com/account/settings" width="800" height="600"></iframe>How is clickjacking different from XSS, CSRF, and formjacking?
All four attacks abuse a browser you trust. Visitors can do little about them. The site under attack must fix each one. PCI DSS 6.4.3 and 11.6.1 target payment page skimming. They require authorized, integrity-checked, and monitored scripts.
| Attack | What it abuses | Who fixes it | Main control |
|---|---|---|---|
| Clickjacking | Your click, through a hidden frame | The framed site | CSP frame-ancestors |
| Cross-site scripting (XSS) | Injected script running as the trusted site | The vulnerable site | Output encoding and sanitization, per OWASP |
| Cross-site request forgery (CSRF) | Your signed-in browser sending a forged request | The target site | CSRF tokens, with SameSite cookies as backup, per OWASP |
| Formjacking (web skimming) | Injected script copying form fields | The site and its script vendors | Script inventory, Subresource Integrity, and tamper alerts |
Site-side web attacks compared. The attacked site fixes each one, not the visitor.
Why do security tools miss clickjacking?
- No malware runs, so endpoint tools see nothing.
- The click is genuine, so logs look normal.
- Some sites still send no anti-framing header.
What should site owners check?
- Send frame-ancestors 'none' unless you need framing.
- Name only trusted origins when you do need it.
- Keep X-Frame-Options as a fallback for old browsers.
- Require re-authentication for payments and security changes.
- Re-test framing after CDN or header changes.
- Treat OAuth grants and permission prompts as high risk.
Does browser isolation stop clickjacking?
- Clickjacking is fixed by a header on the framed site.
- Shield opens a page in an isolated browser off your device.
- That changes where a page runs, not what you click.
Limits
- Header advice applies to sites you control.
- The table reduces each attack to its main control.
- Sources were checked on October 30, 2026.
- Legba publishes this guide. Shield is part of Legba's Chrome extension.
FAQs.
Is clickjacking still possible in modern browsers?
How do websites prevent clickjacking?
What is the difference between clickjacking and CSRF?
How do I test my site for clickjacking?
Does browser isolation stop clickjacking?
Can I set frame-ancestors in a meta tag?
Does SameSite stop clickjacking?
What actions are most at risk?
References
- 01OWASP: ClickjackingOWASP
- 02
- 03
- 04
- 05
- 06
Keep exploring
- ShieldShield opens a page in an isolated browser off your device.
- All guidesThreats, secure apps, and AI security pages.
- All browser threatsBrowse threats by category and intent.
- Secure apps directorySecure browsing guides for top SaaS apps.
- AI security guidesBrowse guides about AI prompt leakage and prompt injection.