The good news is that clickjacking can be prevented — both by users and website owners.
Here’s what you can do.
If You’re a Website Owner
1. Add X-Frame-Options
This tells browsers whether your site is allowed to be loaded inside an iframe.
Using:
-
DENY→ no site can embed yours. -
SAMEORIGIN→ only your own domain can embed your pages.
2. Use a Stronger CSP Rule
Content Security Policy lets you decide who can load your site in a frame:
3. Avoid Putting Sensitive Actions in Frames
If a button performs an important function (payment, settings, etc.), keep it outside iframes.
If You’re a Regular User
-
Don’t trust shady download/play buttons.
-
Keep your browser updated.
-
Use an ad-blocker or iframe-blocking extension.
-
Don’t click random links from unknown sites.
Final Thoughts
Clickjacking works because it targets people, not systems.
The best defense is awareness — knowing how the trick works makes you much harder to fool.
REFERENCES
How to Protect Yourself and Your Website from Clickjacking
-
MDN Web Docs. X-Frame-Options HTTP Header.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options -
Google Web.dev. Content Security Policy – frame-ancestors Directive.
https://web.dev/csp/ -
OWASP Defense Guide. Clickjacking Defense Cheat Sheet.
https://owasp.org/www-community/attacks/Clickjacking

Comments
Post a Comment