Referrer-Policy: Controls how much of the referrer URL is sent on outbound links and requests. Referrer-Policy controls how much of the current page's URL the browser sends in the Referer header when a visitor follows a link or the page loads a resource. strict-origin-when-cross-origin, the modern browser default, sends the full URL within your own site, only the domain to other HTTPS sites, and nothing when moving from HTTPS to HTTP. no-referrer sends nothing at all.
What should you keep in mind with Referrer-Policy?
Setting it explicitly is a small privacy and security improvement. Pages with sensitive information in their URLs, such as password reset links, account pages or search results, should not leak those URLs to third parties like analytics or embedded content. Keep in mind that a stricter policy also reduces the referral data other sites, and your own analytics, receive.
What does an example of Referrer-Policy 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.