What is Clickjacking?


What is Clickjacking Vulnerability, and how does it affect you?

"UI redressing" is a subcategory of "clickjacking." Clickjacking is a harmful practice that involves tricking a web user into engaging with something other than what he expects to deal with. In most circumstances, a clickjacking attack is carried out simply by clicking on a webpage element. A clickjacking attack happens when a user is tricked into clicking one element on a hidden web page or disguised as another element. To keep things short, any assault in which a user mistakenly clicks an unexpected web page element is known as Clickjacking.

You might say that anything we present on a webpage is another page that is translucent on top of the visible one. The term "click hijacking" was created to describe the practice of overlaying harmful material over a trustworthy website or placing a transparent page on top of a visible one on online pages.

While the victim engages with seemingly innocent websites, this sort of attack, which may be employed alone or in conjunction with other attacks, might transmit unwanted orders or divulge personal information.

What a Clickjacking Attack Looks Like in Practice

The most frequent method of Clickjacking is to show the user a combination of two superimposed web pages in the browser window, along with some form of inducement to click in specific spots. The attacker begins by loading the vulnerable target website into an iframe, setting it to full transparency, and placing it in front of a malicious web page designed to elicit clicks in specific locations.

Consider an entertaining browser-based game that appears in a popup window and offers rewards or exciting material to the winners. The game might be displayed as the backdrop page, with the intended online application, such as a banking or e-commerce site, superimposed in a transparent frame on top of it. The attacker designs the game page such that clickable things are in the same place on the targeted site as chosen controls. When a user tries to click in-game items, they touch invisible buttons on a vulnerable web page, which might have significant implications. Depending on the site, the victim may unintentionally give 5-star reviews, like questionable Facebook pages, provide rights to Facebook applications, log in via SSO techniques, or utilize 1-click shopping to transfer pricey things to the attacker.

The attack, when combined with drag-and-drop tactics, might deceive the user into filling out text fields in a web form or CAPTCHAs. In this scenario, the user unintentionally drags content from an unseen page and drops it into a form field due to carefully planned interactions with the game.

Types of Clickjacking Attacks

Clickjacking is a comprehensive name for a group of attack routes and tactics collectively known as UI redress assaults. Based on the usage of superimposed material, attacks may be categorized into two groups. Overlay-based assaults are the most prevalent, and the most common technological strategy is to embed websites in invisible iframes.

There are a few different types of overlay-based Clickjacking &mins;

Complete transparent overlay

This approach was employed in one of the earliest high-profile clickjacking attacks, which tricked users into allowing Flash animations access to the computer's camera and microphone through the Adobe Flash plug-in settings page.

Cropping

In this technique, the attacker selects only a few controls from the transparent page to overlay on the visible page. Depending on the goal of the attack, this could entail hiding buttons with invisible hyperlinks to cause them to perform a different action than intended, replacing text labels with misleading instructions, or covering the entire legitimate page with misleading content, leaving only one original button exposed.

Hidden overlay

This was the first method of Clickjacking that was demonstrated. The attacker places a 1x1 pixel iframe carrying malicious content behind the mouse pointer, hiding it from view but registering any clicks on the infected page.

The legal page is displayed in the forefront, totally covering the malicious page behind it, and the click event is dropped. The attacker changes the top's CSS pointer-events value to none, forcing click events to "drop" through the legal page overlay and only register on the malicious page below.

Rapid content replacement

Opaque overlays cover the targeted controls, which are removed for a fraction of a second to register the click and then replaced. This requires the attacker to predict the exact time of the victim's click, but it's easier than it sounds if you know a little about computer user habits and psychology.

Even if clickjacking vulnerabilities aren't used to implant overlays, attackers have several techniques for persuading users to click unexpected controls −

Scrolling

The attacker slides a genuine dialogue box or other web page element partially off the screen, obscuring some of the controls for the user. For example, a warning dialogue might be slid off the screen, leaving only the OK and Cancel buttons visible, with the attacker placing harmless prompt text to make it appear as though the buttons apply to this message rather than a warning.

Repositioning

To perform this attack, the attacker must quickly relocate a trusted dialogue (or another UI element) under the cursor. At the same time, the victim is preoccupied on clicking other, seemingly harmless elements. If this succeeds, the user will unconsciously click the replaced control before realizing anything has changed. To prevent detection, the attacker may swiftly relocate the dialogue back after the click, similar to fast content substitution.

Drag-and-drop

While most clickjacking attacks focus on intercepting clicks, drag-and-drop vulnerabilities may be used to fool users into doing things like filling out online forms by dragging unseen text into invisible text fields or giving sensitive personal information to the attacker.

How can you avoid being a victim of a clickjacking attack?

There are two methods for avoiding a Clickjacking attack −

1. Protection on the client's side 2. Server-side security ( X-Frame-Options ) Client-side security

Frame-Breaking

Frame Busting is the most frequent client-side strategy for protecting a web page from Clickjacking.This approach prevents a website from working when it is loaded inside a frame.

In this approach, the user's browser's JavaScript is utilized to prevent itself from being embedded in the iframe and to exit it.

When the page loads, this JS code checks to see if the page's domain matches the browser's domain.If it works, no issue; if it does not, it will exit the frame and load the site in the browser, rather than attempting to load it in the Iframe.

X-Frame-Options

Microsoft has built a header-based protection system as an alternative to client-side frame busting code.

The new "X-FRAME-OPTIONS" header is supplied by the server on HTTP replies and is used to indicate which web pages should not be framed. Although "X-FRAME-OPTIONS" is a reasonable solution that has been implemented by most browsers, there are significant drawbacks to this strategy that might lead to exploiting the clickjacking vulnerability in any circumstance.

The header X-Frame-Options is part of the answer. It may be used by developers to prevent their websites from Clickjacking. Its value can be adjusted to any of the following to indicate whether or not a browser should be permitted to display a website in an Iframe:

DENY X-FRAME-OPTIONS No site will be able to load the page in a frame if DENY is used.

SAMEORIGIN X-FRAME-OPTIONS You may still utilize the page in a frame if you provide SAMEORIGIN, as long as the site put it in a frame is the same as the one delivering the page

ALLOW-FROM URI X-FRAME-OPTIONS: If you indicate this, just the URI supplied may be used to show the site in a frame.

Updated on: 15-Mar-2022

224 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements