Home › Cybersecurity wiki › What is clickjacking in a browser?

Wiki

What is clickjacking in a browser?

Clickjacking leads a person to trigger an action on another page without recognizing the action.
A visible decoy page lies over an invisible or shifted target page, and the click hits the hidden element.
The person is signed in, and the browser sends the action with their real session.

Understanding Clickjacking

Clickjacking is a deception of the interface, not a break-in to the server.
The attacker needs a page they serve themselves and a target that can be loaded in a frame.
The victim's browser performs the actual action, so that person's cookies and rights apply.

The Mechanics of Clickjacking

Technically the target page is loaded in a frame and positioned invisible or behind a lure by stylesheet.
The click that seems to belong to the lure hits a button, a checkbox, or a form on the target page.
Multi-step variants guide the pointer so that several clicks land in the right place one after another.

Types of Clickjacking Attacks

Types range from a single hidden click through hijacking of the clipboard to reinterpreting keyboard input.
Likejacking aims at a social action, and other variants aim at a setting, a purchase, or an approval.
What they share is that the visible intent and the action performed fall apart.

Preventing Clickjacking

Prevention ensures that foreign pages cannot embed one's own application in a frame.
In addition, critical actions should require a conscious, visible confirmation that a single blind click cannot satisfy.
The measures belong in the response headers and in the flow of the action.

Using X-Frame-Options

The X-Frame-Options header forbids embedding or allows it only for the same origin.
Browsers that honor the header do not show the page inside a foreign frame.
The header is simple and covers older clients, but it is coarser than a modern frame policy.

Implementing Content Security Policy

A content security policy with frame-ancestors names the origins that may embed the page.
All other embeddings fail, even if an older frame header is missing or contradicts it.
The policy must fit actual use, or legitimate embeddings in one's own portal break.

Using JavaScript to Detect and Block Clickjacking

JavaScript can check whether the page is running as the top window and otherwise stop interaction.
This protection is an addition, because scripts can be suppressed or run only after the first click.
Headers remain the more reliable block, and the script covers residual cases and shows the user the abort.

Clickjacking and CAPTCHA

A CAPTCHA on the critical action is meant to ensure that a person performs the step consciously.
In a clickjacking context, a visible puzzle can itself become the lure, or it can remain unsolved on the hidden page.
CDPCaptcha has the browser solve a small computational task that people hardly notice and that becomes expensive for bots at scale, and it works without cookies and without fingerprinting, but it does not replace the ban on embedding.

Types of CAPTCHA

Visible character and image puzzles require a recognizable action, while behavior checks run in the background.
For clickjacking, what matters is whether the task lies on the hidden page or is consciously seen by the user.
A task that nobody sees does not confirm a conscious click.

Pros and Cons of CAPTCHA

An advantage of classic CAPTCHAs is the interruption of thoughtless clicks, and a disadvantage is the burden on people and the ability to outsource them to solving services.
CDPCaptcha avoids those image puzzles by having the browser solve a small computational task that people hardly notice and that becomes expensive for bots at scale.
Without cookies and without fingerprinting, frame protection remains the actual block against clickjacking, because otherwise the click is performed in the name of the real session.

Conclusion

Clickjacking couples a real session to a click whose target the person does not see.
Frame headers and a conscious confirmation close the path more reliably than a puzzle added afterward.
CAPTCHA can make volume automation more expensive and does not replace the ban on foreign embedding.