The $200 Bug: Explaining the Clickjacking Vulnerability

clickjacking vulnerability explained

Clickjacking, also known as a UI Redress Attack, is a client-side security vulnerability where an attacker tricks a user into clicking on a hidden or disguised element on a web page. By overlaying a transparent iframe containing a legitimate site over a malicious decoy page, the attacker “hijacks” the user’s clicks to perform unintended actions, such as transferring funds or changing account settings.

To secure your application against Clickjacking in 2026, follow this guide to identification, detection, and mitigation.

The Vulnerability Explained

Clickjacking, also known as a “UI redress,” is a malicious technique employed by attackers to deceive users into unintentionally performing actions on a website or application without their knowledge or consent. This form of attack exploits the trust users place in familiar interfaces by overlaying or disguising elements, thereby tricking individuals into clicking on hidden or disguised buttons, links, or other interactive components.

The primary objective of clickjacking is often to manipulate user behavior for malicious purposes such as stealing sensitive information, hijacking accounts, or executing unauthorized transactions.

How Clickjacking Works

Clickjacking involves layering transparent or opaque elements over web content. Attackers craft a malicious webpage that embeds the target website within an iframe, an HTML element that allows one webpage to be embedded within another. By manipulating CSS styles and transparency settings, the attacker makes the embedded page invisible in the content. When a user visits this malicious page and interacts with what appears to be content, such as clicking a button, they are actually interacting with elements on the embedded target site.

The attacker uses social engineering techniques to convert users into visiting the malicious page.

Clickjacking Attacks Workflow

The typical workflow of a clickjacking attack involves several key steps:

  1. Iframe Embedding: The attacker creates a malicious page and embeds the target “victim” website inside an invisible

In this setup:

  • The iframe loads the victim’s settings page.
  • CSS positions and sizes are adjusted so that only part of the iframe aligns with where the “Change Password” button appears.
  • An invisible
  • When users click on what appears to be harmless content (“Click here for your free gift!”), they trigger actions inside the iframe, in this case, submitting the password change form if properly targeted.

How It Works

When a user visits this malicious page:

  • They see enticing content prompting them to click.
  • Clicking on specific areas causes clicks inside the transparent iframe.
  • If they click where the “Change Password” button appears visually (but is covered by our transparent overlay), they trigger an unintended password change request.
  • Alternatively, if CSS positioning aligns perfectly with other sensitive controls (like account deletion), similar attacks can occur.

Mitigation and Defense

Modern browsers and websites have implemented various defenses against clickjacking:

Content Security Policy (CSP): The modern standard. Use the frame-ancestors directive to specify which origins are allowed to frame the site.

Content-Security-Policy: frame-ancestors 'none'; (Disallows all framing)
Content-Security-Policy: frame-ancestors 'self'; (Allows framing only by the same origin)

X-Frame-Options (XFO): An older but widely used header for legacy support.

X-Frame-Options: DENY (Blocks all framing)
X-Frame-Options: SAMEORIGIN (Only allows same-origin framing)

SameSite Cookies: Setting cookies to Strict or Lax prevents them from being sent during cross-site framing, effectively logging the user out within the iframe.

Despite these defenses, poorly configured websites remain vulnerable. Attackers often exploit sites lacking proper headers or employing outdated security practices.

If you find this proof of concept useful, look at our guide on the Log4shell (Log4J) Vulnerability, which allows unauthenticated Remote Code Execution in React Server Components.

Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post
Log4shell Vulnerability

The $2000 Bug: Explaining the Log4shell (Log4J) Vulnerability

Next Post
install git windows 11

How to Install Git on Windows 11