Clickjacking Mitigation & Remediation
Prevention Measures:
- X-Frame-Options Header:
Set HTTP header: X-Frame-Options: DENY
or SAMEORIGIN
MDN Reference
- Content Security Policy (CSP):
Use: Content-Security-Policy: frame-ancestors 'none'
MDN Reference
- Frame-Busting Script:
Add to your page's HTML:
<script>if(top !== self) top.location.href = self.location.href;</script>
Remediation Steps:
- Implement server-side headers (X-Frame-Options or CSP)
- Test using this PoC tool after implementation
- Use combination of client-side and server-side protections
- Regularly audit sensitive pages