How to fix: Missing Referrer-Policy Header
The Referrer-Policy header is not set. This controls how much referrer information is sent with requests.
Why it matters
Sensitive information in URLs (tokens, IDs) may be leaked to third-party sites through the Referer header.
By default, browsers send the full URL in the Referer header when navigating between pages. If your URLs contain sensitive data, this data leaks to any external site the user visits next.
How to fix it
- 1Add Referrer-Policy: strict-origin-when-cross-origin (recommended).
- 2For maximum privacy, use no-referrer or same-origin.
- 3Avoid using unsafe-url which sends the full URL to all origins.
Code examples
Next.js
const nextConfig = {
async headers() {
return [{
source: '/(.*)',
headers: [{ key: 'Referrer-Policy', value: 'strict-origin-when-cross-origin' }],
}];
},
};Nginx
add_header Referrer-Policy "strict-origin-when-cross-origin" always;Apache
Header always set Referrer-Policy "strict-origin-when-cross-origin"Caddy
header Referrer-Policy "strict-origin-when-cross-origin"Express (Node.js)
app.use((req, res, next) => {
res.setHeader('Referrer-Policy', 'strict-origin-when-cross-origin');
next();
});Deno (Hono)
app.use('*', async (c, next) => {
await next();
c.header('Referrer-Policy', 'strict-origin-when-cross-origin');
});Bun (Elysia)
app.onAfterHandle(({ set }) => {
set.headers['Referrer-Policy'] = 'strict-origin-when-cross-origin';
});HTML Meta Tag
<meta name="referrer" content="strict-origin-when-cross-origin">References
Detected automatically by VulnRadar. The check id is referrer-policy-missing, stable across every scan so you can filter or diff on it.
More headers checks
- HighMissing HTTP Strict Transport Security (HSTS)
- HighMissing Content Security Policy (CSP)
- MediumMissing Clickjacking Protection
- LowMissing Permissions-Policy Header
- MediumWildcard CORS Policy
- LowMissing X-XSS-Protection Header
- MediumDangerous CORS Configuration
- InfoMissing Cross-Origin-Resource-Policy (CORP)
Questions
- How severe is Missing Referrer-Policy Header?
- VulnRadar rates this low severity in the headers category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
- Does VulnRadar check for this automatically?
- Yes. It runs as part of every scan under the check id referrer-policy-missing, which stays the same between runs so you can filter, diff, or gate CI on it.
- Which standards does Missing Referrer-Policy Header map to?
- It maps to CWE-200. In the OWASP Top 10 it falls under A05:2021.
Missing a check?
The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.