What does 'Missing Referrer Policy' mean in Site Audit?
Missing Referrer Policy
Description
Your site is missing the Referrer-Policy header, which controls how much referrer information is included with requests. The Referrer-Policy header controls how much information is included in the Referer header when a user navigates from your site to another site. Without this policy, sensitive information in URLs might be leaked to third-party sites when users click on external links.
How to Fix
Add a Referrer-Policy header to your server responses. A secure value is 'no-referrer-when-downgrade' or 'same-origin'. For example: 'Referrer-Policy: no-referrer-when-downgrade'
Detailed Analysis
Certainly! Let’s delve into the SEO issue titled "Missing Referrer Policy".
1. What Causes This Issue
The "Missing Referrer Policy" issue arises when a website does not explicitly set the Referrer-Policy
HTTP header. This header is a security feature that tells the browser how much of the referring URL should be shared with third-party sites when a user clicks on a link. Without this policy, the default behavior of browsers can vary, potentially leading to the leakage of sensitive URL information to third-party sites.
2. Why It's Important
-
Privacy Protection: By controlling the referrer information, you protect sensitive data that might be embedded in URLs, such as user IDs, session tokens, or other personal data that could be inadvertently shared with third-party sites.
-
Security Enhancement: Limiting referrer information can prevent malicious sites from gathering data about the user’s navigation history, which could be used in targeted attacks or phishing schemes.
-
SEO Considerations: Although primarily a security feature, having a well-defined
Referrer-Policy
can also indirectly influence SEO by ensuring that traffic data is accurately reported in analytics tools, helping to maintain a clear understanding of traffic sources.
3. Best Practices to Prevent It
-
Set a Referrer-Policy Header: Always define a
Referrer-Policy
for your website. This can be done through server configuration files, .htaccess, or directly in your application’s codebase. Common directives include:no-referrer
: No referrer information is sent.no-referrer-when-downgrade
: Default in most browsers. Sends referrer information to secure (HTTPS) sites.origin
: Only the origin (domain) of the document is sent as referrer.strict-origin-when-cross-origin
: Sends full URL from secure to secure requests, but only sends origin information from secure to non-secure or cross-origin requests.
-
Evaluate Your Needs: Choose the policy that best fits your privacy and security requirements while considering the user experience and functionality of your site.
-
Regularly Update and Review Policies: As web standards and security practices evolve, regularly review and update your security headers to align with the latest best practices.
4. Examples of Good and Bad Cases
Good Case
-
A website sets a
Referrer-Policy
ofstrict-origin-when-cross-origin
. This setting provides a balance between usability and security by sharing full referrer details for same-origin requests, but only the origin for cross-origin requests. This policy helps protect user privacy without compromising the functionality of modern web applications.Referrer-Policy: strict-origin-when-cross-origin
Bad Case
-
A website does not set any
Referrer-Policy
, leaving it to the browser’s default behavior. In some browsers, this could mean sending full URL referrer information to any site, potentially leaking sensitive data embedded within URLs to third-party websites.Referrer-Policy: (Not Set)
By implementing a clear and appropriate Referrer-Policy
, websites can enhance user privacy and security while maintaining the integrity of their analytics and SEO strategies.
Updated about 5 hours ago