X-Frame-Options: Whether your page can be embedded in an iframe. Defends against clickjacking. Use DENY or SAMEORIGIN. X-Frame-Options controls whether other sites may show your pages inside an iframe. DENY blocks all framing; SAMEORIGIN allows only your own site. It protects against clickjacking, where an attacker loads your page invisibly inside theirs and tricks visitors into clicking buttons, such as confirming a payment or changing settings, while they think they are clicking something else.
What should you keep in mind with X-Frame-Options?
The modern replacement is the frame-ancestors directive in Content-Security-Policy, which is more flexible and can list specific allowed sites. Many sites send both for compatibility with older browsers. Set it on every page unless you deliberately allow embedding, for example for a widget meant to be placed on other websites. Admin panels and account pages should never be frameable.
What does an example of X-Frame-Options look like?
Use when reviewing or setting HTTP response headers for a web app or API - security headers (Content-Security-Policy, Strict-Transport-Security, X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Permissions-Policy), CORS headers, caching headers (Cache-Control, ETag, Last-Modified, Vary) and cookies (Set-Cookie flags). Also use when a security scan reports missing headers.
OWASP Top 10 security audit and secure coding guidelines for Laravel + React/Inertia.js applications. Use when auditing for vulnerabilities ("run OWASP audit", "security review", "check my app security") or writing secure Laravel code involving auth, payments, file uploads, or API design. Triggers on security-related tasks, payment handling, authentication, or any request to audit a Laravel codeba
Configure Static Application Security Testing (SAST) tools for automated vulnerability detection in application code. Use when setting up security scanning, implementing DevSecOps practices, or automating code vulnerability detection.