Clickjacking meaning, in plain words

Clickjacking overlays an invisible screen so a click does something else. How it works, how it differs from CSRF, and the frame-ancestors fix.

Written by: Mio Kanzaki(Security Analyst (AI))Reviewed by: 千葉圭介Updated

Clickjacking is a technique that overlays an invisible screen so that a click does something the user did not intend. IPA describes it as an attack in which a crafted outside site visually deceives the user into unknowingly clicking, and so running, a function of a genuine site they are logged in to.

How does clickjacking work?

Imagine a transparent film laid over a button on a desk, with a different picture drawn on it. What you see is a "claim your prize" button in the picture, but what you actually press is another button under the film.

On the web, another site's page is shown in a nearly transparent frame (an iframe) laid over the page. The user believes they pressed the button on the front screen, but they pressed a function of the genuine site underneath. The targets are functions usable after login that can be run with mouse clicks alone.

The root countermeasure IPA gives is to restrict embedding in other sites' frames with the response header X-Frame-Options. OWASP explains that X-Frame-Options has been superseded by frame-ancestors and is outdated. Asking for the password again just before an important action is also listed as a root measure. How to check is on the clickjacking vulnerability page.

Why does clickjacking matter?

IPA describes the impact as similar to CSRF: abuse of the service, sending out information or cancelling membership against the user's wishes, and changes to settings or visibility. Where operations concern a user's information, the damage is larger.

CSRF exploits a missing check on the site's side. Clickjacking deceives the user's eyes so that the user clicks personally. Because the person operates a real browser, a check by token alone does not stop it.

That is why a setting that restricts embedding in frames is the basic defence. It takes a single header line, a measure with little burden to introduce. If you do want other sites to embed your pages, decide which sites you will allow.

The free URL check shows what is visible from outside, including whether the response headers carry such settings.

Related terms

  • CSP: its frame-ancestors item can restrict embedding in frames.
  • CSRF: a technique that also causes unintended operations, exploiting a missing check on the site's side.

Next step

Check whether your site's admin screens and member pages can appear inside another site's frame. How to check and fix it is on the clickjacking vulnerability page. To talk through the settings, contact us.

Frequently asked questions

Which sites does clickjacking target?

Sites with a function, behind login, that can be run with mouse clicks alone. Screens where changing settings, switching visibility or cancelling membership takes one click can be targets.

Should I use X-Frame-Options or CSP's frame-ancestors?

OWASP explains that X-Frame-Options has been superseded by frame-ancestors and is outdated. Some old browsers still follow X-Frame-Options, so sending both is one way to operate. Choose the value by whether you want other sites to embed your pages.

Frequently asked questions

Which sites does clickjacking target?

Sites with a function, behind login, that can be run with mouse clicks alone. Screens where changing settings, switching visibility or cancelling membership takes one click can be targets.

Should I use X-Frame-Options or CSP's frame-ancestors?

OWASP explains that X-Frame-Options has been superseded by frame-ancestors and is outdated. Some old browsers still follow X-Frame-Options, so sending both is one way to operate. Choose the value by whether you want other sites to embed your pages.

See what an attacker can see, today

The free URL check returns a grade in under a minute. For costs and next steps, book a free consultation.