Explore our new Cybersecurity Terms Glossary, explained by our experts.
Cybersecurity Terms Glossary
Clickjacking hides a legitimate web page in an invisible frame so users click something other than what they see. Learn how it works and the headers that stop it.

What Is Clickjacking?
Clickjacking is an attack that tricks a user into clicking something different from what they believe they are clicking, usually by loading a legitimate website inside an invisible frame on top of a decoy page. The victim thinks they are pressing “Play” or closing a pop-up; in reality they are confirming a transfer, changing a setting, or granting a permission on a site where they are already logged in. It is also known as UI redressing.
The attacker builds a page with something enticing on it and loads the target site in an iframe positioned exactly over the bait. A few lines of CSS make the frame fully transparent and place it above everything else:
<iframe src="https://victim.example/account/delete"></iframe>
iframe { position: absolute; top: 0; left: 0;
width: 600px; height: 400px;
opacity: 0; z-index: 2; }
A visible button such as “Watch the video” sits underneath, lined up with the real “Delete account” button in the hidden frame. Because the browser sends the victim’s cookies with the framed page, the click is fully authenticated. The decoy looks innocent; the action is real.
The term was coined in 2008 by researchers Jeremiah Grossman and Robert Hansen, whose demonstrations included switching on a victim’s webcam and microphone by hiding Adobe Flash’s settings manager beneath an innocent-looking page.
Clickjacking matters wherever a single click, or a short sequence of clicks, performs a sensitive action: account and security settings, one-click purchases, admin panels, payment confirmations, and OAuth consent screens. Unlike cross-site request forgery, it defeats anti-CSRF tokens, because the request is made by the real page with the real token—the user simply did not intend to click. It is tracked as CWE-1021, Improper Restriction of Rendered UI Layers or Frames.
On its own, clickjacking is usually rated medium or low severity, but it becomes serious when paired with a high-impact one-click action or chained with other weaknesses such as cross-site scripting.
The fix is to tell the browser which sites may frame your pages. Two HTTP response headers do this:
frame-ancestors 'none', or 'self', or a list of trusted origins. This is the modern, flexible control, and it supports multiple allowed origins.DENY or SAMEORIGIN. It is older but still useful for legacy browsers; the ALLOW-FROM option is obsolete and ignored by modern browsers.Send both on every response that renders HTML, not just the login page. Further measures help:
SameSite=Lax or Strict, so they are not sent when your site is framed by another origin.Checking is quick: inspect a page’s response headers, or load it inside an iframe in a local HTML file. If it renders, it can be framed. Burp Suite’s Clickbandit tool builds a working proof of concept in minutes. Missing anti-framing headers are among the most common findings in web application assessments, and they are cheap to fix—often a single line in your web server, application framework, or CDN configuration.
Our web application security services check framing protections alongside the rest of the OWASP Top 10.
Yes, although browsers and frameworks have made it less common. Many applications still omit anti-framing headers on some pages, and newer techniques such as double-clickjacking work even where framing is blocked. The impact depends on what a single click can do in your application, so it remains worth testing, especially for admin panels, payment flows, and OAuth consent pages.
Content-Security-Policy frame-ancestors is the modern standard and takes precedence in current browsers. X-Frame-Options is still worth sending as a fallback for older browsers and some embedded clients, and it costs nothing. Make sure the two do not contradict each other: if CSP allows a trusted partner origin, X-Frame-Options SAMEORIGIN will be ignored by modern browsers but may block that partner in older ones.
Similar attacks exist on mobile. On Android, tapjacking uses overlay windows drawn on top of another app to capture or redirect taps, which is why recent Android versions restrict overlays over sensitive screens such as permission prompts. Web content opened in a mobile browser is vulnerable to classic clickjacking exactly as on desktop, so the same anti-framing headers apply.
Not directly. Same-origin rules stop the attacker’s page from reading what you type into a framed site. Clickjacking makes you perform actions, such as changing a recovery email address or approving an application’s access, and those actions can then lead to account takeover. Some variants trick users into typing into hidden fields, so anti-framing headers are still the real fix.
You May Be Interested In These
We use a few cookies that are needed to make this website work, and they are always on. We would also like to set analytics cookies, to see which pages are useful; functional cookies, so that our live chat works; and advertising cookies, to measure our campaigns. We will not set any of those until you say yes, and you can change your mind at any time from the Cookie Settings link in the footer.
Choose the cookies you are happy for us to use. Strictly necessary cookies are always on; everything else is off until you turn it on.
These cookies keep the website working: they hold your security checks, your form submissions and the choice you make here. The site cannot run without them, so they are always on.
These let our live chat open and remember your conversation, and let the newsletter sign-up work. Switch them off and the chat window will not appear.
These tell us which pages are read and how people find us, so that we can improve the site. The reports are about groups of visitors, never about you personally.
These let us measure our advertising and show you our adverts on other websites, such as LinkedIn, Google and Meta. Switch them off and you will still see adverts, but they will be less relevant.