ENES

Clickjacking

Tricking you into clicking something on a hidden page layered under a decoy.

A bait page with a big 'Win a prize' button; on top of it, an invisible framed bank page lines up its 'Transfer' button exactly where the user clicks

Clickjacking hides a real website inside an invisible frame on top of a bait page. The victim sees a harmless button, like "Play video" or "Claim your prize", but the click actually lands on a button of the hidden page: "Delete account", "Confirm transfer", "Allow camera". Because the victim is already logged in to that site in the same browser, the action runs with their session. The name was coined in 2008 by researchers Jeremiah Grossman and Robert Hansen; it is also called UI redressing.

The trick needs only standard web pieces: an <iframe> that loads the target page, CSS that makes it fully transparent and positions it precisely, and a lure that makes people click in the right spot. Variants hijack "Like" buttons (likejacking) or chain several clicks into a little game. It is a cousin of CSRF: both abuse the fact that the browser sends your cookies to a site even when another page started the action, but in clickjacking you click yourself.

The fix is on the target site, and it is simple: tell browsers not to show your pages inside frames from other origins. The modern way is the Content Security Policy header frame-ancestors 'none' (or a list of allowed origins); the older header X-Frame-Options: DENY or SAMEORIGIN does the same for legacy browsers. Cookies marked SameSite add another layer, since the framed page then loads without your session. Sensitive actions that ask for a password or a second confirmation are also harder to hijack.

Keep in mind

Go deeper

Related terms

More in Security