The Novee Gym is open for business at Black Hat Europe

Book a meeting

The Novee Gym is open for business at Black Hat Europe

Book a meeting

Glossary › Clickjacking

Clickjacking

Explore Article +

Key Takeaways

  • Clickjacking, also called UI redressing, tricks users into clicking a hidden page instead of the one they see.
  • It rides on the victim’s existing session, so any one-click, state-changing action is a potential target.
  • Automated scanners flag missing headers but rarely judge whether a page is actually exploitable.
  • CSP frame-ancestors is the primary clickjacking prevention control, with X-Frame-Options as a fallback.

What Is Clickjacking?

Clickjacking is an attack in which a malicious page loads a legitimate site in an invisible layer so the victim’s click lands on a hidden control instead of the visible decoy. Because the browser can send the user’s cookies with the framed request, the action runs with the victim’s permissions.

Jeremiah Grossman and Robert Hansen publicized the technique in 2008. MITRE tracks it as CWE-1021, Improper Restriction of Rendered UI Layers or Frames.

How a Clickjacking Attack Is Technically Constructed

The attacker embeds the target application in an iframe on their own page, often a settings or confirmation screen on a site where the victim is logged in. CSS sets the iframe’s opacity to zero, so it is invisible but still receives clicks.

Absolute positioning and a high z-index then stack the transparent iframe above a decoy such as a “Play” button, aligned exactly over the sensitive control. Multi-click flows use games that move the decoy between clicks.

What Clickjacking Attacks Are Used to Achieve

  • Self-spreading posts. In February 2009, a “Don’t Click” button made Twitter users unknowingly post the attacker’s link to their own feeds.
  • Likejacking. In 2010, Sophos reported scams that hid Facebook’s Like action behind lures.
  • Device permissions. A 2008 proof of concept framed Adobe Flash Player’s Settings Manager so clicks enabled the visitor’s webcam and microphone.
  • Account changes. Changing security settings or confirming payments are typical modern targets.

Why Clickjacking Is Frequently Missed in Security Testing

Most scanners only check whether a response carries X-Frame-Options or frame-ancestors. A missing header becomes one more low-severity alert, and the scanner cannot tell a one-click funds transfer from a static marketing page.

Gaps also hide in specific routes: a header on the main app may be absent on a legacy endpoint, subdomain or proxied response. Real risk depends on business logic, such as which actions need only a click. Pairing web application security testing tools that validate exploitability with penetration testing frameworks such as the OWASP Web Security Testing Guide, which includes a dedicated clickjacking test, closes the gap.

How X-Frame-Options and CSP Prevent Clickjacking

Both headers tell the browser which sites may embed a page.

X-Frame-Options

DENY blocks all framing and SAMEORIGIN allows only same-origin pages. ALLOW-FROM is obsolete and ignored by modern browsers, leaving the page unprotected, and the header accepts only one value.

CSP frame-ancestors

The modern successor. frame-ancestors 'none' matches DENY, 'self' permits same-origin framing, and you can list several trusted origins. Every ancestor in a nested frame chain is checked.

When to use each

Use frame-ancestors as the primary control. When both are present, CSP-aware browsers ignore X-Frame-Options, so sending it too is a cheap fallback for older clients. Neither header works from a meta tag. Block framing unless a page needs embedding.

Novee’s continuous AI pentesting reasons about web app workflows and business logic, separating a harmless missing header from an exploitable path. Three independent agents validate each finding, and Agentic Remediation retests to verify the fix.

FAQ

It can capture more than clicks. OWASP describes keystroke hijacking, where crafted iframes and text fields make victims believe they are typing into a trusted page while their input goes into a hidden frame. Drag-and-drop variants can also move content between frames. Framing headers block these variants too.

No. HTTPS encrypts traffic between browser and server, but clickjacking happens inside the victim’s browser, where a legitimate HTTPS page loads in a hidden frame and works normally. Only framing controls such as CSP frame-ancestors or X-Frame-Options tell the browser to refuse embedding.

Yes. Mobile browsers render iframes and CSS much like desktop browsers, so a framed page can sit beneath a decoy tap target, and they honor the same framing headers. In native apps, a related overlay technique called tapjacking falls under the same weakness, CWE-1021.

Yes, though the bar is higher. Some browsers now restrict cross-site cookies in frames by default, blocking many session-based attacks. Pages without framing headers remain exposed, and DoubleClickjacking, disclosed in late 2024, sidesteps framing defenses by manipulating a double-click across separate windows.

It has been. A 2008 proof of concept framed Adobe Flash Player’s Settings Manager so a victim’s clicks enabled their webcam and microphone. Modern browsers make this harder: cross-origin iframes need explicit camera or microphone delegation through the Permissions Policy allow attribute.