No history yet

Introduction to Clickjacking

What You Click Isn't Always What You Get

On the web, a click can do almost anything, from liking a photo to transferring money. We trust that when we click a button, it will do what it says. But what if the button you see isn't the one you're actually clicking? This is the core idea behind an attack called clickjacking.

Clickjacking

noun

An attack that tricks a user into clicking on something different from what they perceive, potentially leading to unintended actions on a different website.

Think of it like this: someone asks you to sign a guestbook on a clipboard. You sign your name on the page you see. Later, you find out they had placed a transparent sheet over a legal contract. Your signature didn't land on the guestbook; it landed on the contract underneath. You were tricked into signing something you never intended to.

Clickjacking works similarly. An attacker loads a hidden, legitimate webpage on top of their own deceptive page. You see one thing, but your clicks go straight through to the invisible page.

How It Works

The magic trick behind clickjacking involves an HTML element called an iframe. An iframe is like a window on a webpage that can display another webpage inside it. Attackers create a harmless-looking website with a tempting button, like "Claim Your Prize!"

Then, they create an invisible iframe and load a completely different website into it—say, your social media profile page. They carefully align this invisible iframe so that an important button on the hidden page, like "Delete Account," is directly underneath the "Claim Your Prize!" button.

When you visit the attacker's page and click the prize button, you aren't actually clicking it. Your click passes through to the invisible button on the legitimate site. If you're already logged into that site, the action is performed instantly. You've just been jacked.

Common Scenarios

Clickjacking doesn't always involve deleting your account. The actions can be subtle and hard to notice. An attacker could trick you into:

  • Liking or sharing content: You might be lured into clicking a button that secretly "likes" a social media page or shares a link you've never seen.
  • Changing your settings: A click could unknowingly change your account's privacy settings, making your private information public.
  • Authorizing an application: You could be tricked into granting a malicious app access to your data or account privileges.
  • Initiating a purchase: On a shopping site, a click could add an item to your cart or even complete a one-click purchase if your payment details are saved.

The key is that you are performing these actions yourself, even though you've been deceived. To the website, it looks like a legitimate click from an authenticated user.

The lesson here is to make sure you always know what you're clicking on.

Modern web browsers and websites have ways to defend against clickjacking, but understanding the threat is the first step in staying safe. Being aware of how these attacks work can help you recognize when something seems off.