hackweb
notes on hacking and technology
IT EN
main menu
user menu
you are not logged in

Clickjacking: the click that was not for you

November 3, 2024 · 1 min read · #web #clickjacking #ui

Clickjacking tricks the user into clicking elements of another site, invisible because overlaid in a transparent iframe.

The trick

The attacker loads the target site in an <iframe> with opacity:0, aligning a sensitive button ("Delete account", "Authorize") over a lure ("Win a prize"). The user thinks they click the lure but clicks the real action, authenticated by their cookies.

<iframe src="https://bank.com/settings" style="opacity:0;position:absolute"></iframe>
<button>Click here!</button>  <!-- aligned under the real button -->

Defence

Prevent framing: Content-Security-Policy: frame-ancestors 'self' (modern) or X-Frame-Options: DENY/SAMEORIGIN. For critical actions, require explicit confirmation or re-authentication, which a blind click cannot satisfy.


« back to home

latest posts
 
your IP address:
216.73.216.108
visitor #1
MOTD:
Every abstraction leaks somewhere.
Here we look at where.
topics