Skip to main content
All Terms Glossary

Clickjacking

Definition

Clickjacking is an attack where malicious actors trick users into clicking something different from what they perceive, often by overlaying transparent elements over legitimate buttons or links. This can lead to unwanted actions, data theft, or malware installation. To prevent clickjacking, developers implement frame-busting code and use security headers like X-Frame-Options or CSP frame-ancestors to control how their pages can be embedded in iframes.

How clickjacking works

Clickjacking, a form of UI redressing, tricks a user into interacting with a page they cannot see. The attacker loads a legitimate target site inside an invisible or near-transparent iframe and positions it over decoy content, so a button the user believes they are clicking actually lands on a control in the framed page, confirming a payment, changing a setting, granting a permission. Variants include dragging content into hidden fields, hijacking cursor position, or overlaying fake prompts. The victim is genuinely authenticated on the target site, so every click carries their real session and privileges. Nothing is technically injected into the target; the deception is purely visual layering.

Why it matters

Because the framed application receives authentic, authenticated clicks, clickjacking can trigger state-changing actions that the user never intended: transferring funds, deleting data, approving an OAuth scope, following an account, or toggling a security setting. It sidesteps input validation and even multi-factor authentication, since the user is already logged in and voluntarily clicking. It also composes with other tricks, likejacking on social platforms and cursorjacking that steals keystrokes into hidden inputs. Any page that performs a sensitive one-click action and can be embedded in a frame is a candidate, which makes it a broad risk for banking, admin panels, and account settings pages.

How to defend against it

The reliable defenses are server-set response headers that tell the browser not to render your page in someone else's frame. Send Content-Security-Policy frame-ancestors with an explicit allowlist (or 'none'), and set X-Frame-Options: DENY or SAMEORIGIN for older clients; frame-ancestors supersedes X-Frame-Options where both apply. Legacy JavaScript frame-busting is a weaker fallback that attackers can neutralize. For sensitive actions, add confirmation steps that resist blind clicking. Because these headers are part of a page's secure-header posture, cside's monitoring can flag when a third-party script or misconfiguration strips or weakens them, helping ensure framing protections stay in place in production.

Definition

How is clickjacking different from cross-site scripting?

XSS injects and runs attacker code inside your page's origin. Clickjacking injects no code at all; it visually overlays your real page inside a hidden frame so the user's genuine clicks hit controls they cannot see. XSS abuses code execution, clickjacking abuses the interface and the user's trust in what they are clicking.

Definition

Does HTTPS prevent clickjacking?

No. HTTPS encrypts traffic and authenticates the server, but it does nothing to stop your page from being embedded in a malicious frame. Clickjacking is defeated by framing controls such as the CSP frame-ancestors directive and X-Frame-Options, not by transport encryption.

Got more questions

Talk to a security expert

We answer client-side security questions every day. Bring yours.

Book a demo

Want to walk through this with an engineer?

Thirty minutes, on your own site. Not a slide deck.

Book a personalized demo to see:

How to achieve PCI DSS requirement 6.4.3 & 11.6.1 compliance in 1 day
Why third-party scripts are a security risk for you and your visitors
Monitoring privacy and consent leakage (GDPR, CCPA) across every third party
Stopping signup abuse, account sharing, and chargeback fraud with device intelligence
Detecting and controlling AI agents and bots hitting your site in real time

Rather just send a question?

Finding open slots…

Real humans only. We'd know.

Having trouble booking? Open scheduler in a new tab

What are you trying to solve?

Tell us in a line and we'll come back with something useful, not a generic pitch.

We usually help with:

Seeing which third-party scripts run on your site
PCI DSS 6.4.3 and 11.6.1 evidence
Bots, AI agents and account takeover

Prefer to just book a time? Pick a slot instead