Clickjacking

Clickjacking, also known as User Interface (UI) redress attack, is a malicious web security exploit in which an attacker tricks a user into clicking on something different from what they perceive, leading to unintended actions such as authorising transactions, changing settings, or revealing sensitive information. The attack manipulates the graphical interface of a legitimate website, usually by overlaying transparent or disguised frames that capture user clicks meant for visible content.

Background and Development

The concept of clickjacking emerged in the early 2000s with the rise of interactive web technologies. The term was popularised in 2008 by security researchers Jeremiah Grossman and Robert Hansen, who demonstrated how web browsers could be exploited by framing elements and deceiving users. Since then, clickjacking has evolved into a family of attacks, including likejacking, cursorjacking, and cookiejacking, all of which rely on misleading the user interface.
Clickjacking exploits the very features that make modern web applications dynamic and interactive—iframes, cascading style sheets (CSS), and JavaScript. It capitalises on the fact that a website can be embedded within another site using iframes unless explicitly restricted. This flexibility allows attackers to craft pages that appear harmless but secretly perform unintended operations when users interact with them.

Mechanism and Techniques

The core mechanism of clickjacking involves the use of hidden or partially transparent layers that obscure the true target of a user’s click. For example, an attacker may create a page that displays a visible button such as “Play Video”, while underneath it lies an invisible iframe containing a sensitive action button, such as “Transfer Funds” or “Like Page”. When the user clicks the visible element, the underlying button is activated instead.
Common forms of clickjacking include:

  • Classic Clickjacking – A legitimate website is embedded in a hidden frame, and the victim’s clicks execute actions on that site using their existing session credentials.
  • Likejacking – Exploits social media interactions by tricking users into unintentionally liking or sharing content.
  • Cursorjacking – Alters the appearance or actual position of the cursor so that clicks register in different locations than expected.
  • Cookiejacking – Involves deceptive actions that extract browser cookies or session information.

These attacks often combine social engineering with technical tricks to ensure the victim interacts willingly, believing they are performing a benign action.

Impact and Consequences

Clickjacking can lead to a wide range of security and privacy issues. Depending on the nature of the embedded target, the consequences can include:

  • Unauthorised transactions or purchases.
  • Activation of hardware permissions such as camera or microphone.
  • Sharing of private information or unintended social media posts.
  • Modification of account settings or personal data.
  • Distribution of malicious software or links.

In the corporate and financial sectors, clickjacking poses significant risks by allowing attackers to exploit authenticated sessions, making the malicious activity appear legitimate from the system’s perspective.

Detection and Testing

Detecting clickjacking vulnerabilities requires both automated and manual analysis. Security testers examine whether a web page can be framed within another site. This can be done by attempting to embed the page using an iframe and observing whether it is displayed. Tools and browser-based scanning utilities are often used to identify missing or misconfigured security headers.
Key indicators of vulnerability include:

  • Absence of X-Frame-Options header.
  • Lack of a Content Security Policy (CSP) directive specifying trusted frame sources.
  • Sensitive functions accessible through single-click actions without confirmation steps.

Developers and testers must ensure that critical user actions cannot be performed unintentionally through embedded or hidden content.

Defence and Mitigation Measures

Defending against clickjacking involves restricting how a web page can be displayed within other sites and designing interfaces that minimise the potential for deceptive interaction. The principal security measures include:

  • Content Security Policy (CSP): The directive frame-ancestors allows site owners to define which origins are permitted to embed their content. This is the modern and most flexible defence.
  • X-Frame-Options Header: An older but widely supported HTTP response header that can be set to DENY, SAMEORIGIN, or ALLOW-FROM to prevent unauthorised framing.
  • SameSite Cookie Attribute: Restricts the use of cookies in cross-site requests, reducing the risk of session exploitation.
  • UI Hardening: Designing web applications so that important actions require multiple confirmations, two-factor authentication, or re-entry of credentials.
  • Secure Interface Design: Using browser-native permission prompts for sensitive actions such as camera or microphone access, rather than relying on in-page controls.

When implemented together, these measures significantly reduce the likelihood and impact of clickjacking attacks.

Browser Behaviour and Implementation Considerations

While the X-Frame-Options header is still commonly used, it has limitations, such as inconsistent support for ALLOW-FROM across browsers. The Content Security Policy (CSP) frame-ancestors directive is therefore preferred, offering greater control and compatibility with modern browsers. Developers should also consider differences in browser behaviour, plug-in handling, and rendering of legacy technologies that might still be exploitable.
Websites that incorporate third-party widgets, advertisements, or social media integrations are particularly at risk, as these external contents may introduce unwanted framing behaviour. Continuous security reviews and audits are necessary to maintain a robust defence against evolving attack techniques.

Significance in Web Security

Clickjacking represents a classic example of how legitimate web design capabilities can be repurposed for malicious purposes. It demonstrates the importance of adopting a defence-in-depth approach—combining secure coding, proper configuration, and user awareness to prevent attacks that rely on deception rather than direct exploitation.
For organisations, protection against clickjacking is an essential part of maintaining a secure online presence. It helps preserve user trust, prevent financial fraud, and safeguard personal information. As browsers and web standards evolve, developers must keep security headers up to date and follow best practices to ensure ongoing protection.

Originally written on January 13, 2018 and last modified on November 11, 2025.
Tags:

Leave a Reply

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