Foxcolab

Glossary

Clickjacking

Definition

Clickjacking: A UI redress attack: a malicious page loads a real website in a transparent or disguised frame and aligns its buttons under something the user means to click, so the click acts on the hidden site. Sites prevent it with CSP frame-ancestors or X-Frame-Options.

Also known asUI redress attackUI redressingframe hijacking

In short

Clickjacking, or a UI redress attack, loads a real website in a hidden or disguised frame on an attacker's page and lines up its buttons under something you mean to click, so your click acts on the hidden site where you're signed in. Sites stop it by refusing to be framed, with the Content-Security-Policy frame-ancestors directive and the older X-Frame-Options header.

Key takeaways

  • Clickjacking turns your own click into an action on a site hidden in a frame.
  • It works because you're signed in to the hidden site, so it acts as you.
  • The fix belongs to the framed site, which tells browsers who may embed it.
  • frame-ancestors 'none' blocks every frame and overrides X-Frame-Options when both are sent.
  • Protect every page that has an action, not only the sign-in page.

Last reviewed 4 December 2026 by Foxcolab Team

Clickjacking is an attack in which a malicious page loads a real website inside a hidden or disguised frame and lines up that site's buttons under something you mean to click. Your click lands on the hidden site, where you're signed in, so it acts as you. OWASP calls it a "UI redress attack," in which "an attacker uses multiple transparent or opaque layers to trick a user into clicking on a button or link on another page."

A worked example#

OWASP's classic case: a page offers a "click here for a free iPod" button. Over it sits an invisible frame showing your webmail, positioned so its "delete all messages" button is exactly where the bait is. You click for the prize and empty your inbox. Any action that takes one or two clicks is a target, such as making a private file public.

How sites stop it#

The defense belongs to the site being framed: it tells the browser who may embed it.

Http
Content-Security-Policy: frame-ancestors 'none'
X-Frame-Options: DENY
ControlWhat it does
frame-ancestorsPart of Content Security Policy. It "restricts the URLs which can embed the resource," says CSP Level 3. 'none' blocks everyone, 'self' allows your own origin, or list trusted origins
X-Frame-OptionsThe older header. DENY or SAMEORIGIN. When both are sent, "the frame-ancestors directive overrides the X-Frame-Options header"
SameSite cookiesOWASP also suggests SameSite=Strict or Lax on sign-in cookies, so a page framed by another site tends to load signed out

The common mistake is protecting only the sign-in page. Every page with a button worth hijacking needs the header, including settings and sharing screens.

In Foxcolab#

Foxcolab Drive, Docs, Sheets, Notes, Whiteboard and the Forms editor send both frame-ancestors 'none' and X-Frame-Options: DENY, so browsers refuse to show them inside another site's frame. foxcolab.com sends X-Frame-Options: SAMEORIGIN. Embedded forms are the one deliberate exception, because they're made to sit on your website. To keep a form off other sites, open its Settings, go to Link preview & search and add your domains to Sites allowed to embed; anywhere else, the form shows "This form can't be shown on this site." See share, embed and prefill a form.

Clickjacking only pays off against a signed-in session, so it pairs with session hijacking as a reason to sign out of devices you don't use. Create a free account.

Keep exploring

All terms

Foxcolab

Private work tools, without the ads.

Mail, files, documents, spreadsheets and meetings in one account. Files, documents and spreadsheets are end-to-end encrypted.

Jump to