Clickjacking
Clickjacking is a type of attack where a user is tricked into clicking on something different from what they intended, typically because a malicious or hidden element is layered on top of a legitimate-looking webpage. An attacker may embed a trusted site inside a transparent frame so that the victim believes they are interacting with familiar content while actually triggering unintended actions. The deception relies on visual manipulation rather than exploiting code vulnerabilities directly.
Clickjacking is a client-side interface-based attack in which an adversary renders a target webpage, typically via an HTML iframe, as a transparent or opaque layer positioned over attacker-controlled content. When a victim interacts with the visible page, their clicks are intercepted by the concealed layer and directed to actionable elements on the framed target site, such as buttons or links, without the victim's knowledge or consent. The attack exploits the browser's willingness to render cross-origin framed content and requires no compromise of the target server. Mitigations are applied at the HTTP response level, commonly through frame-blocking directives such as the X-Frame-Options header or the Content Security Policy frame-ancestors directive, which instruct compliant browsers to restrict or deny framing of the protected resource.
Why it matters
Clickjacking represents a meaningful threat to web application users because it subverts trust rather than exploiting a technical code flaw. A victim may believe they are interacting with a familiar, legitimate interface while their clicks are silently redirected to hidden elements on a framed page, potentially triggering account changes, purchases, permission grants, or social media actions without their awareness or consent. Because the deception occurs entirely in the browser and requires no server-side compromise of the target site, it can be difficult for users to detect through normal behavioral cues.
The attack class is particularly relevant because its mitigations are straightforward to implement at the HTTP response level, yet many web applications still omit the necessary headers. The X-Frame-Options header and the Content Security Policy frame-ancestors directive are both well-established controls that instruct compliant browsers to refuse to render a page inside a frame from an unauthorized origin. When these controls are absent, any attacker who can serve a webpage to a victim may be able to construct a clickjacking scenario targeting that application. This makes the absence of framing controls a recurring finding in security assessments of web applications.
Who it's relevant to
Inside Clickjacking
Common questions
Answers to the questions practitioners most commonly ask about Clickjacking.