1. Education

What is clickjacking? How to perform it

Disclaimer: This is a user generated content submitted by a member of the WriteUpCafe Community. The views and writings here reflect that of the author and not of WriteUpCafe. If you have any complaints regarding this post kindly report it to us.

Clickjacking is a type of cyber-attack where a user is tricked into clicking on something different from what the user perceives, effectively hijacking their clicks. This malicious technique can lead to various security vulnerabilities, from stealing personal information to controlling a user’s browser.

Clickjacking Attack Example

A common example of clickjacking involves layering a transparent iframe over a seemingly benign webpage. For instance, a clickjacking attack might place a transparent iframe over a “Like” button on a website. The user thinks they are clicking on a regular part of the page, but they are actually clicking on the “Like” button in the invisible iframe.

Mitigating Clickjacking

There are several methods to mitigate clickjacking attacks:

  1. Using X-Frame-Options Response Header: This header tells the browser whether the content can be displayed within an iframe. By configuring this option, a website can prevent its content from being framed by other sites, which is a common clickjacking technique.
  2. Content Security Policy (CSP): CSP can also be used to prevent clickjacking by restricting how resources are loaded on the site.
  3. Client-Side Scripting: Javascript can be used to ensure that the site is not being embedded in a frame.

Using the SAMEORIGIN Option to Defend Against Clickjacking

The X-Frame-Options: SAMEORIGIN response header is a powerful tool against clickjacking. It allows the page to be displayed in a frame on the same origin as the page itself. This means that the page can be framed by other pages from the same site, but not by external sites.

Limitations of X-Frame-Options

While effective, the X-Frame-Options header does have limitations:

  • It is not supported by all browsers.
  • It does not provide granular control over framing.
  • It cannot prevent other types of UI redressing attacks that do not use frames.

Clickjacking Test — Is Your Site Vulnerable?

Testing for clickjacking vulnerability typically involves checking whether your web application headers are properly configured to prevent framing by external sites. Tools like web security scanners can be used to automate this testing.


What is a Real-Life Example of Clickjacking?

A real-life example of clickjacking occurred in 2010 with the “Like” button on Facebook. Attackers created invisible layers over websites that led users to unknowingly “Like” a Facebook page when they thought they were clicking on something else.

What are the Risks of Clickjacking?

The risks include unauthorized actions on a user’s behalf, stealing personal information, spreading malware, and potentially gaining control over a user’s account or device.

What are the Solutions for Clickjacking?

Solutions involve implementing security headers like X-Frame-Options, Content Security Policy, and employing client-side defensive scripting.

What Category is Clickjacking?

Clickjacking is categorized under UI redress attack in the realm of web security.

What Causes Clickjacking?

Clickjacking is caused by the ability to overlay transparent frames on a webpage and the user’s inadvertent interaction with these frames.

What is Clickjacking Also Known As?

Clickjacking is also known as UI redress attack, IFRAME overlay, and “Likejacking” when specifically referring to Facebook.

Is Clickjacking a Cyber Threat?

Yes, clickjacking is a significant cyber threat as it can lead to unauthorized actions, data theft, and security breaches.

How Common is Clickjacking?

Clickjacking is relatively common due to the simplicity of the attack and the broad range of potential targets.

What are the Advantages of Clickjacking?

For attackers, clickjacking can be advantageous as it is easy to implement, hard to detect, and can affect a wide range of users.

What is Clickjacking Tester?

A clickjacking tester is a tool or software used to assess whether a website is vulnerable to clickjacking attacks.

What is Clickjacking Defense?

Clickjacking defense refers to the methods and practices implemented to protect against clickjacking attacks, such as the use of security headers and client-side scripting.

How Does Clickjacking Collect Personal Data?

Clickjacking can trick users into revealing personal information by overlaying invisible forms over seemingly harmless web elements.

What is the Difference Between Clickjacking and Phishing?

While both are deceptive practices, clickjacking tricks users into clicking on something different than intended, while phishing typically involves tricking users into providing personal information under false pretenses.


Clickjacking is a significant security concern in the digital world. Understanding what it is, how it works, and how to protect against it is crucial for both web developers and users. Implementing robust security measures and staying informed about potential threats are key to safeguarding against clickjacking and maintaining a secure online environment.


Welcome to WriteUpCafe Community

Join our community to engage with fellow bloggers and increase the visibility of your blog.
Join WriteUpCafe