hello@wpfoss.com
Website SecuritySecurity HeadersClickjacking

What is clickjacking and can it happen to your website?

Clickjacking tricks people into clicking your site without knowing it. What it is, who is at risk, what a scan means by it, and what to ask your developer.

By WPfoss Team

Your security scan says your site “can be shown inside another website” and calls the risk clickjacking. The name sounds dramatic and does not explain itself. Is someone hijacking your visitors? Is your site hacked?

Short answer: no, your site is not hacked. Clickjacking is a trick played on your visitors, using your real website as the bait. It is worth closing, and the fix is small. This guide explains it in plain English.

What clickjacking is

Most websites can be loaded inside a box on someone else’s page. That box is called a frame. It is how a map or a video is embedded in a page, and it is normal.

Clickjacking abuses that. An attacker builds a page that looks harmless, such as a prize draw or a “watch this video” page. Hidden on top of it, invisible to the eye, is your real website in a frame. The visitor thinks they are clicking “Play”. They are actually clicking a button on your site, such as “Confirm”, “Delete” or “Send”.

The OWASP security project, which writes guidance for web developers, also calls this a UI redress attack: the screen the visitor sees is not the screen they are clicking on.

Who is at risk

The trick only does harm when the clicked button does something. So it matters most for pages where a logged-in person can take an action:

  • Your admin area. If you are logged in to your site and click a hidden button, you could approve or change something without meaning to.
  • Customer accounts and checkouts. A hidden “Pay” or “Update details” button on a page a customer is already signed in to.
  • Any page with a one-click action, such as deleting, approving, sending or following.

A plain brochure page with nothing to click is a much lower risk. That is why a scan often flags this as medium or low, not critical.

Why a scan flags it

Your site can tell browsers “do not let other websites put me in a frame”. If that instruction is missing, a scanner reports that your pages can be framed. Our own website security checker includes a clickjacking check for this.

There are an older and a newer way to give that instruction, both set as HTTP headers, which are short notes your site sends to the browser along with every page:

  • X-Frame-Options, the older one.
  • The frame-ancestors rule inside a content security policy, the newer one. Our guide to what a content security policy does explains that header.

OWASP says the newer rule takes priority when both are present, and that it is best to set more than one protection where you can. It also gives one warning that catches many site owners: these instructions only work as headers. Putting the same words in a page’s own code, in a meta tag, does not work.

What it does not do

Be clear on the limits, so you do not worry more than you should:

  • It does not steal your password or copy your files.
  • It does not mean someone has broken into your site.
  • It only works on a visitor who is already logged in, and who is tricked into clicking.
  • It does not help an attacker on pages that do nothing when clicked.

OWASP also notes that framing is not the only variation: a newer trick called DoubleClickjacking uses separate windows and needs extra safeguards on sensitive actions. That is one more reason this is a layer of defence and not a full answer on its own.

Do you ever need your pages framed?

Sometimes, yes. If your booking form or payment page is meant to appear inside a partner’s site, or you embed your own pages inside another of your sites, framing has a real purpose. In that case the instruction should allow those specific sites, and nobody else. OWASP says that where no one needs to frame your content, blocking it completely is the recommended default.

Do not guess here. Blocking everything can break a page that was meant to be embedded, and allowing everything leaves the door open.

What to ask your developer or host

You do not need the technical words to ask. Put these in an email and keep the answers:

  1. Do our pages tell browsers not to let other websites frame them? Which pages, and how is it set?
  2. Is it set as a header, not as a tag inside the page?
  3. Do we embed any of our own pages inside another site? If so, which sites are allowed?
  4. Does our admin and customer login area have the strictest setting?
  5. Does the setting stay in place after a site update, a plugin change or a move to a new host?

If the answers are “I am not sure”, that is useful to know. It is a short job for a developer, not a rebuild.

Want us to check it?

Start with the free website security checker: it shows whether your pages can be framed and what else a stranger can see. If you would like someone to fix what it finds and check the rest of your setup, see our website security service.

Sources and further reading

  • OWASP Cheat Sheet Series: Clickjacking Defense. Source for the definition (also called UI redress), the two header protections, the newer one taking priority, headers working only as headers and not as meta tags, blocking framing being the recommended default where no one needs it, and the DoubleClickjacking note. Read in full for those sections.

Stop impersonation. Control access. Protect your business.

Choose the service you need, or book a security review and we will help you identify the correct starting point.