Skip to main content
What is Clickjacking?
  1. Glossary/

What is Clickjacking?

7 mins·
Ben Schmidt
Author
I am going to help you build the impossible.

When you are building a startup, you focus on the features your users want. You build the buttons. You design the flow. You want the user to click Sign Up or Buy Now. But what happens when that click goes somewhere else entirely? Clickjacking is a term for a specific type of security vulnerability that lives in the user interface. It is often called UI redressing. It involves a malicious actor overlaying a hidden or transparent layer over your actual website. The user thinks they are clicking a button on your legitimate site. In reality, they are clicking an invisible button on a different site hidden beneath or above your page. This is not just a technical glitch. It is a fundamental breach of the trust relationship between you and your user.

In the context of a startup, this is a nightmare scenario. You are working hard to establish credibility in a market where you are likely the underdog. If a user discovers that clicking a link on your platform resulted in them unknowingly following a random account on social media or, worse, authorizing a financial transaction, your brand is effectively dead. Founders often think of security as something that happens in the database or during the login process. Clickjacking proves that security is just as important at the visual layer where the user interacts with your code.

Understanding the Mechanics of the Attack

#

The primary tool for a clickjacking attack is the HTML iframe. An iframe allows a developer to embed one website inside another. This is standard practice for things like YouTube videos or Google Maps. However, an attacker can use CSS to make an iframe completely transparent. They set the opacity to zero. Then they position that invisible iframe directly over a button on their own malicious site. When a victim visits the attacker site, they see what looks like a harmless game or a survey. They see a button that says Play Now. When they click that button, they are actually clicking the hidden iframe which might be your startup login page or a delete account button.

This works because the browser treats the click as an interaction with the topmost layer. If the topmost layer is an invisible window to your site, the browser executes the action on your site using the user’s active session. This is why clickjacking is so effective. It leverages the fact that the user is already logged into your service. The attacker does not need to steal the user’s password. They simply need to trick the user into using their own authenticated session to perform an action the attacker wants.

There are several variations of this technique. Some attackers use strokejacking, which involves mimicking the user typing. Others use flash based attacks or even dragging and dropping elements to bypass security checks. The common thread is the manipulation of the visual space to hide the true nature of the interaction. For a founder, understanding these mechanics is the first step toward building a resilient platform. You cannot fix what you do not understand.

Clickjacking vs Phishing

#

It is common to confuse clickjacking with phishing, but they are distinct threats with different signatures. Phishing is a form of social engineering where an attacker creates a fake website that looks exactly like yours. The goal is to trick the user into entering their credentials. In a phishing attack, the user is interacting with a fake environment. The data they type is sent to the attacker. The success of phishing depends on the attacker’s ability to create a convincing replica of your brand.

Clickjacking is different because the user is interacting with the real website. The buttons are real. The session is real. The site in the hidden iframe is your actual production site. The deception is not in the design of the page but in the layering of the interface. In phishing, the attacker wants your data. In clickjacking, the attacker wants your permission or your action. They want you to click the button that says Transfer Funds or Change Password. Because the site is the real one, many traditional security measures like SSL certificates do not prevent clickjacking. The browser correctly shows that the connection is secure because it technically is. The problem is that the user is being tricked into using that secure connection for an unintended purpose.

Common Scenarios for Founders to Watch

#

Where should a founder be most concerned about clickjacking? Any page that performs a state change is a high risk target. A state change is any action that modifies data or permissions. If you have a settings page where a user can change their email address, that is a target. If you have a dashboard where a user can invite new team members or delete projects, those are targets. Even something as simple as a Like or Follow button can be jacked to artificially inflate engagement for a malicious actor.

Consider a fintech startup. If your application allows a user to approve a payment with a single click, that button is a massive liability if not protected. An attacker could embed your payment approval page in a hidden iframe on a movie streaming site. Users might click a play button that is actually your Pay button. This can lead to unauthorized financial transfers. The same applies to e-commerce startups. A One-Click Buy button is a feature for users but a vulnerability if clickjacking is possible. You must audit every interaction that has a consequence and ensure it cannot be triggered from outside your controlled environment.

Another scenario involves privacy. An attacker could use clickjacking to trick a user into changing their privacy settings to Public. This could expose sensitive user data that was previously private. For a health tech or legal tech company, this kind of data exposure is a legal and ethical catastrophe. It can lead to regulatory fines and a total loss of user confidence. Security is not just a feature. It is a core component of your product’s value proposition.

How to Defend Your Startup

#

The good news is that defending against clickjacking is relatively straightforward once you know it exists. The most effective method is to tell the browser not to allow your site to be framed by others. You can do this using the X-Frame-Options HTTP response header. There are three main values for this header. DENY prevents any site from framing yours. SAMEORIGIN allows only your own site to frame your pages. ALLOW-FROM allows you to specify a list of trusted domains. Most modern startups should use DENY or SAMEORIGIN by default.

There is also a more modern approach called Content Security Policy or CSP. The frame-ancestors directive in a CSP provides more granular control than the older X-Frame-Options header. It allows you to define exactly which parent pages are allowed to embed your content. Implementing these headers is a low effort task for a developer, but it provides a high level of protection. It effectively shuts the door on most basic clickjacking attempts.

We should also consider the unknowns. As we move toward more complex web components and micro frontends, how does the boundary of a frame change? Will new browser features unintentionally create new ways to layer interfaces? We must also ask how automated security scanners can better detect invisible overlays that current manual testing might miss. As a founder, you should be asking your technical team if your site uses these headers. You should also ask how they verify that no new pages are being created without these protections. Security is a process of constant questioning and verification. You are building something to last, so make sure the foundation is secure.