A frame turns someone else's UI into your attack surface. Ask whether a sensitive action can be embedded and disguised, and whether the server forbids framing.
HTML frames allow one origin to render another origin's page. Without X-Frame-Options or CSP frame-ancestors, an attacker can overlay a transparent iframe and route a real click into a privileged control.
The victim sees a legitimate page and performs a real click. The browser cannot tell that the visible control belongs to the attacker.
What is actually at stake?
Before touching a payload, map the assets, the actors and the boundary that is supposed to protect them. A finding only becomes a vulnerability when you can connect the failed boundary to a real asset.
Assets
- Administrative approvals
- Refunds and payouts
- Security settings and MFA
- Data exports and impersonation
Actors
- Attacker who can host a page
- Malicious ad or social link
- Compromised site embedding the target
- Insider sending a crafted page
Trust boundaries
- Target page to framing origin
- Visible UI to actual click target
- Single click to privileged action
- Browser frame policy to server headers
Abuse cases
- Frame an admin approval and overlay a prize button
- Use opacity and positioning to hide the target
- Trick a double click into a confirmation
- Frame a sensitive settings page
- Bypass a JavaScript frame-buster
Follow the decision, not the payload
Every family has a moment where trusted data becomes an authorization, parsing or state decision. Learn to point at that moment in the request path.
- 01
Frame
The attacker page loads the target in an iframe; the browser asks whether framing is allowed.
- 02
Disguise
The attacker overlays transparent or misleading content so the visible control differs from the target control.
- 03
Click
The victim clicks the attacker's page; the browser routes the click to the framed target.
- 04
Action
The target performs the privileged action with the victim's session.
- 05
Impact
The attacker achieves a state change without reading the response or stealing a token.
The invisible approval
Composite case study from public clickjacking disclosuresA composite case based on common admin-console reviews: a refund approval page had no frame protection and completed with one click.
A tester embedded the approval page in an iframe, placed a transparent overlay over the button, and clicked the bait. The refund was approved.
An attacker could approve refunds, grant roles or export data by convincing an administrator to click a harmless-looking page.
The sensitive page lacked CSP frame-ancestors and X-Frame-Options, and the action required only one click.
Send frame-ancestors 'none' and X-Frame-Options: DENY, require confirmation for high-impact actions, and avoid one-click privileged controls.
Read it as a chain: discovery → failed decision → impact → fix. Then ask which link would have broken earliest.
A repeatable testing sequence
- Find a sensitive action that needs one click.
- Check X-Frame-Options and CSP frame-ancestors.
- Build a framing page on a different origin.
- Disguise the click with an overlay and verify the action fires.
- Show the state change or data exposure.
Where smart people get fooled
- X-Frame-Options: SAMEORIGIN is not protection against a different origin, but a missing header is worse.
- A frame-busting JavaScript snippet can be bypassed or may not run.
- CSP must include frame-ancestors; default-src does not cover framing.
- A button that requires typing or a second confirmation is much harder to clickjack.
What would the logs show?
A control is stronger when someone can see it fail. These signals are starting points for a detection rule, not a complete SIEM use case.
- Sensitive pages loaded inside a cross-origin frame
- CSP reports for frame-ancestors violations
- A burst of approvals or exports after a user visits an external page
- Clicks on high-impact controls with no preceding in-app navigation
- Pages with no X-Frame-Options or frame-ancestors directive
index=web sourcetype=app_logs action=admin.approve | stats count values(referer) by user_id, action | where count > 0 AND NOT match(referer,"^https://academy\.buggravity\.com/")Fix the decision, then prove it stays fixed
- Send Content-Security-Policy: frame-ancestors 'none' on sensitive pages.
- Keep X-Frame-Options: DENY for legacy browsers.
- Require confirmation or re-authentication for high-impact actions.
- Design sensitive controls so a single blind click cannot complete them.
# Sensitive admin response
Content-Type: text/html
# No frame protectionContent-Security-Policy: frame-ancestors 'none'
X-Frame-Options: DENY
Cache-Control: no-storeframe-ancestors is the modern control; X-Frame-Options is a legacy fallback. Use both on sensitive pages and require a deliberate confirmation for high-impact actions.
Regression tests a reviewer would ask for
Frame blocked
GivenA sensitive admin page
WhenAn attacker origin embeds it in an iframe
ThenThe browser refuses to render the frame
CSP directive
GivenThe page sends a CSP
WhenThe policy is inspected
Thenframe-ancestors 'none' is present, not only default-src
Legacy header
GivenAn older browser ignores CSP
WhenIt reads X-Frame-Options
ThenDENY prevents framing
Confirmation
GivenA high-impact action is framed
WhenThe user clicks once
ThenA second deliberate confirmation is required
What this finding is not
Strong testers kill their own findings before someone else does. These are the shortcuts that turn a real bug into a weak report — or a false alarm into a wasted escalation.
- The page sets X-Frame-Options: SAMEORIGIN and the attacker is on a different origin: framing is blocked, so the basic attack fails.
- A frame-buster script exists: test whether it runs before the click and whether it can be bypassed.
- The iframe loads but the action needs a typed confirmation: a blind click is not enough.
- CSP exists but lacks frame-ancestors: default-src does not protect framing; check the exact directive.
Terms you should be able to use precisely
- Clickjacking
- UI redress where a victim's click is routed to a different, often privileged, control.
- iframe
- An HTML element that embeds another browsing context inside a page.
- frame-ancestors
- A CSP directive naming which origins may frame the page.
- X-Frame-Options
- A legacy response header that can deny or restrict framing.
- UI redress
- Disguising the true target of a user interaction.
- Frame buster
- JavaScript intended to break out of a frame; it is not a reliable security control.
Answer these without reciting a payload
Why is X-Frame-Options: SAMEORIGIN not enough for a cross-origin attacker?
SAMEORIGIN blocks frames from other origins. It protects against the basic attack, but a missing header or a same-origin framing path can still be abused; frame-ancestors is more precise.
Does a frame-busting script fix clickjacking?
No. It can be bypassed with sandboxing, double framing or disabled JavaScript. Server headers are the reliable control.
How do you reduce clickjacking impact even if framing is possible?
Require a deliberate second confirmation, re-authentication or a non-click interaction for high-impact actions.
Can you separate the mechanism from the payload?
Four questions, graded on the server. Answers and explanations are released only after you submit, and signed-in learners keep a best score.
Clickjacking لا تسرق جلسة؛ تستغل إطارًا شفافًا لتوجيه نقرة حقيقية إلى زر إداري. الحل الأساسي هو منع التأطير عبر CSP frame-ancestors وX-Frame-Options، وليس الاعتماد على JavaScript. وحتى مع الحماية، اجعل الإجراءات الحساسة تتطلب تأكيدًا واعيًا أو إعادة مصادقة، لأن النقرة الواحدة يجب ألا تكفي.
If the action requires two deliberate steps, does the clickjacking story still work?