A missing secure Referrer-Policy header means the application has not explicitly defined how much of the current page URL a browser may disclose when the page loads another resource or sends a user to another location.
MDN defines Referrer-Policy as the HTTP response header that controls how much referrer information is included in requests. For most public websites and web applications, the practical baseline is:
Referrer-Policy: strict-origin-when-cross-origin
OWASP recommends explicitly sending strict-origin-when-cross-origin on responses. It preserves complete same-origin referrer information, reduces secure cross-origin disclosure to the origin, and suppresses the referrer during an HTTPS-to-HTTP downgrade.
What Does “Missing Secure Referrer-Policy Header” Mean?
The Referer request header can contain the source origin, path, and query string. The spelling is intentionally historical: the request header is named Referer, while the controlling response header uses the correct spelling, Referrer-Policy.
Modern browser behavior defaults to strict-origin-when-cross-origin when no valid policy is specified. That default reduces risk in current browsers, but relying on an implicit user-agent default creates several problems:
Policy ambiguity
Security, privacy, compliance, development, analytics, and operations teams cannot easily confirm whether the observed behavior is intentional or inherited from a browser default.
Delivery inconsistency
Different origins, subdomains, redirects, error pages, static assets, legacy applications, reverse proxies, and CDNs may emit different headers or no header at all.
Scanner findings
OWASP includes missing or insecure security directives within security misconfiguration, so scanners commonly report an absent policy even when a modern browser applies a safer default.
Future control drift
An explicit response header is easier to version, test, monitor, audit, and enforce through infrastructure-as-code and deployment pipelines.
Is the finding always high severity?
No. The impact is contextual. A static marketing page with clean URLs usually has lower exposure than an authenticated portal whose URLs contain account references, search terms, invitation identifiers, workflow state, or other user-specific data. The finding becomes more important when pages make cross-origin requests, load third-party content, link to external domains, or expose sensitive information in paths and query strings.
For a wider review of this scanner category, see Ammune’s guide to an HTTP security header not detected.
Security and Privacy Risks of an Unsafe or Missing Policy
Full path and query disclosure
A Referer value may include the source path and query string. Under a permissive policy, a navigation or resource request can reveal details such as the page a user viewed, an internal workflow name, a search query, a document identifier, a campaign parameter, or a tenant-specific route to another origin.
Sensitive values embedded in URLs
OWASP explains that sensitive information placed in query strings can appear in browser history, server logs, proxy logs, and Referer headers, and that HTTPS alone does not eliminate this exposure. Referrer-Policy reduces one channel, but the primary remediation is to keep confidential data out of URLs.
Third-party resource visibility
Analytics services, advertising tags, fonts, images, scripts, error-reporting services, support widgets, payment providers, identity providers, embedded media, and external links may receive referrer information. web.dev recommends reviewing whether URLs contain identifying or sensitive information before choosing a policy.
Downgrade leakage
Strict policies suppress the Referer header when a secure HTTPS page requests or navigates to a less secure HTTP destination. The permissive unsafe-url directive can send the full origin, path, and query string regardless of the destination’s security level.
False trust in inbound Referer
The header is not an authentication or authorization mechanism. Nginx’s official referer-module documentation warns that a Referer value is easy to fabricate, and OWASP advises applications not to rely on the URL or referrer when making authorization decisions.
Referrer-Policy Directives Compared
The current Referrer-Policy header supports eight documented directives. The table below translates their behavior into deployment guidance.
| Directive | Same-origin request | Secure cross-origin request | HTTPS to HTTP | Practical assessment |
|---|---|---|---|---|
no-referrer |
No referrer | No referrer | No referrer | Strongest privacy; may reduce analytics and integration context |
same-origin |
Full origin, path, and query | No referrer | No referrer | Strong cross-origin privacy while preserving internal navigation detail |
strict-origin |
Origin only | Origin only | No referrer | Useful when path detail is unnecessary even inside the site |
strict-origin-when-cross-origin |
Full origin, path, and query | Origin only | No referrer | Recommended general-purpose baseline |
origin |
Origin only | Origin only | Origin only | Hides path detail but still sends the origin on downgrade |
origin-when-cross-origin |
Full origin, path, and query | Origin only | Origin only | Less strict because downgrade requests still receive the origin |
no-referrer-when-downgrade |
Full origin, path, and query | Full origin, path, and query | No referrer | Legacy behavior that exposes more cross-origin URL detail |
unsafe-url |
Full origin, path, and query | Full origin, path, and query | Full origin, path, and query | Avoid for sensitive or authenticated applications |
MDN recommends selecting the strictest policy that still allows the site to operate correctly. The value should be based on actual product requirements rather than a blanket assumption that every site needs the same balance.
How to Choose the Right Secure Policy
General website or SaaS application
Start with strict-origin-when-cross-origin. It retains detailed same-origin analytics while reducing cross-origin disclosure and blocking downgrade referrers.
Banking, healthcare, account, or admin portal
Evaluate same-origin or no-referrer, especially when page locations reveal account state, case identifiers, internal routes, or user activity.
Public content with origin-level referral needs
Use strict-origin when cross-origin recipients need to know the source domain but neither same-origin nor cross-origin destinations need full path detail.
Analytics-dependent legacy application
Test strict-origin-when-cross-origin first. Replace path-level cross-domain dependencies with explicit campaign, event, or server-side attribution rather than weakening the global policy.
Payment and identity redirects
Confirm whether the provider needs an origin, a return URL, a state value, or another explicit parameter. Do not assume the full Referer path is a supported or secure integration contract.
API-only hostname
Apply consistent hardening if required by policy, but recognize that browser document responses—not JSON payloads—normally establish the outgoing referrer behavior.
Decision framework
1. Inventory browser-rendered documents, external links, redirects, iframes, and third-party resources 2. Identify URLs containing user, tenant, transaction, workflow, search, invitation, or recovery context 3. Remove secrets and sensitive identifiers from paths and query strings 4. List legitimate consumers of referrer information and the minimum detail they need 5. Start with strict-origin-when-cross-origin 6. Test same-origin, secure cross-origin, and HTTPS-to-HTTP behavior 7. Move sensitive sections to same-origin or no-referrer when appropriate 8. Add element-specific exceptions only when a documented integration requires them 9. Deploy at one authoritative layer and prevent conflicting duplicates 10. Monitor the effective header and integration outcomes after every release
strict-origin-when-cross-origin unless a documented privacy requirement justifies a stricter value or a validated integration requirement justifies a carefully scoped exception.Header, Meta Tag, Element Attribute, and Link Precedence
The HTML Standard defines an order in which referrer-policy signals are applied: a noreferrer link relationship can override other values, followed by an element’s referrerpolicy attribute, a document-level meta referrer value, and then the HTTP Referrer-Policy header.
| Control point | Example | Scope | Recommended use |
|---|---|---|---|
| HTTP response header | Referrer-Policy: strict-origin-when-cross-origin |
Document-wide policy | Primary control for consistent server and edge governance |
| HTML meta element | <meta name="referrer" content="same-origin"> |
Document-wide policy after HTML processing | Fallback when response headers cannot be changed |
Element referrerpolicy |
<a referrerpolicy="no-referrer"> |
One link or resource request | Narrow exception for a documented external destination |
Link rel="noreferrer" |
<a rel="noreferrer"> |
One navigation | Suppress the referrer for a specific external link |
| Fetch request option | referrerPolicy: "no-referrer" |
One programmatic request | Use only when request-level behavior is intentionally different |
MDN documents the meta referrer option, while the HTML Standard documents the referrerpolicy attribute for hyperlinks and external resource links. Keep exceptions rare, explicit, and testable.
How to Fix the Missing Header on Common Platforms
Generic HTTP response
Referrer-Policy: strict-origin-when-cross-origin
Apply the header to browser-rendered HTML responses, redirects, error pages, and any route that can initiate browser navigation or resource loading. Verify whether the edge, reverse proxy, application, or framework already emits a value before adding another one.
Nginx
server {
listen 443 ssl;
server_name app.example.com;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
location / {
proxy_pass http://application_backend;
}
}Test normal responses, redirects, authentication failures, application errors, and static files. Nginx header inheritance can change when a lower configuration block defines its own add_header directives, so inspect every relevant location.
Apache HTTP Server
Apache mod_headers provides directives to set, replace, merge, or remove response headers.
<IfModule mod_headers.c>
Header always set Referrer-Policy "strict-origin-when-cross-origin"
</IfModule>Use the normal late-processing mode for production and verify that upstream applications or proxy modules do not add a second conflicting value.
Microsoft IIS
Microsoft documents adding custom HTTP response headers at the site or application level in IIS.
<configuration>
<system.webServer>
<httpProtocol>
<customHeaders>
<remove name="Referrer-Policy" />
<add name="Referrer-Policy"
value="strict-origin-when-cross-origin" />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>Prefer site-specific configuration over a server-wide value when different applications have different privacy and integration requirements.
Node.js and Express with Helmet
import express from "express";
import helmet from "helmet";
const app = express();
app.use(
helmet({
referrerPolicy: {
policy: "strict-origin-when-cross-origin",
},
})
);Confirm whether the stricter Helmet default is acceptable. Explicitly configure the chosen policy so future dependency changes do not silently change the application contract.
Next.js
Next.js documents setting response headers through the headers option in next.config.js.
const nextConfig = {
async headers() {
return [
{
source: "/(.*)",
headers: [
{
key: "Referrer-Policy",
value: "strict-origin-when-cross-origin",
},
],
},
];
},
};
export default nextConfig;If a CDN or hosting platform also adds the header, decide which layer is authoritative and remove duplicate configuration.
HTML meta fallback
The HTML meta referrer element can set a document policy when server headers cannot be changed.
<meta name="referrer"
content="strict-origin-when-cross-origin">The response header remains preferable for centralized enforcement. A meta tag is parsed from the document and does not provide the same edge-level governance.
Per-link and per-iframe restrictions
<a href="https://external.example/"
referrerpolicy="no-referrer">
Open external service
</a>
<iframe src="https://partner.example/widget"
referrerpolicy="origin">
</iframe>Use element-level policies only for narrow, documented needs. A patchwork of exceptions is harder to audit than a strong global policy with a small number of reviewed overrides.
Setting Referrer-Policy at the CDN or Cloud Edge
Edge enforcement is useful when multiple origins, legacy applications, static sites, and error responses need one consistent policy. It also creates a risk of duplication if the origin already sets the header.
Cloudflare
Cloudflare Response Header Transform Rules can add, set, or remove headers in responses sent to visitors. Use a static value and define whether the rule applies globally or only to selected hostnames and paths.
Cloudflare Workers
Cloudflare provides an official Workers example for setting common security headers, including Referrer-Policy. Use Workers when header logic requires code or conditional behavior beyond Transform Rules.
Amazon CloudFront
CloudFront response headers policies can add custom headers to responses and optionally override origin values. Attach the policy to every relevant cache behavior.
Azure Front Door
Microsoft documents adding security response headers through Azure Front Door Rules Engine. Associate the rule set with the correct route and use an overwrite strategy when the edge should be authoritative.
Azure Application Gateway
Application Gateway v2 supports adding, removing, or updating request and response headers through rewrite rules. Validate rule conditions and listener coverage.
Multiple delivery layers
Document which component owns the header. Test the public response rather than assuming the origin configuration survives CDN, WAF, proxy, cache, and application processing.
How to Test the Effective Referrer-Policy
1. Inspect the public response with curl
curl documents the -I or --head option for retrieving HTTP headers.
curl -I https://app.example.com/ curl -sS -D - -o /dev/null https://app.example.com/login curl -sS -D - -o /dev/null https://app.example.com/not-found
Verify the main page, authentication pages, redirects, not-found responses, server errors, static pages, alternate hostnames, language routes, and cached edge responses.
2. Inspect the browser Network panel
Chrome DevTools documents viewing Response Headers and Request Headers for each network request. Confirm both the policy received by the page and the actual Referer sent on subsequent requests.
3. Test all three request relationships
| Test case | Source | Destination | Expected with strict-origin-when-cross-origin |
|---|---|---|---|
| Same origin | https://app.example.com/account/view?id=7 |
https://app.example.com/api/profile |
Full source URL may be sent |
| Secure cross origin | https://app.example.com/account/view?id=7 |
https://analytics.example.net/event |
Only https://app.example.com/ is sent |
| Security downgrade | https://app.example.com/account/view?id=7 |
http://legacy.example.net/ |
Referer is omitted |
4. Prototype before deployment
Chrome DevTools supports local response-header overrides. This can help teams test analytics, external links, payment redirects, identity flows, embedded resources, and application behavior before changing the production edge or origin.
5. Use a security-header scanner
Mozilla’s HTTP Observatory evaluates HTTP headers and other security configurations. Treat the scan as one input: verify real browser behavior, route coverage, and application context rather than relying only on a grade.
6. Add automated deployment checks
Validation requirements - Exactly one effective Referrer-Policy value - Expected value on HTML documents, redirects, and error responses - No unsafe-url or unintended legacy value - No CDN and origin conflict - Same-origin behavior matches product analytics needs - Cross-origin requests disclose only approved detail - HTTPS-to-HTTP requests omit the Referer - Sensitive values are absent from URLs - Element-level overrides are inventoried and approved - Monitoring alerts when the public header changes
Common Problems and Troubleshooting
| Problem | Likely cause | Resolution |
|---|---|---|
| Header appears twice | Origin, reverse proxy, framework, and CDN all set a value | Choose one authoritative layer and remove or overwrite the others |
| Header exists on 200 responses but not errors | Server directive applies only to selected status codes | Use the platform option that applies the header consistently, such as Nginx always or Apache Header always |
| Scanner still reports missing header | Scanner tested another hostname, redirect, protocol, path, or edge location | Retest the exact public URL chain and every canonical or alternate hostname |
| Analytics lost page-level referral detail | Cross-origin recipients now receive only the source origin | Use explicit campaign or event fields rather than weakening the global policy |
| Partner integration claims it needs Referer | Legacy integration uses an undocumented path-level dependency | Confirm the supported contract; use a scoped element policy only when risk is understood and approved |
| Meta tag appears ineffective | An element override, noreferrer relationship, or response header takes precedence | Inspect the effective response and the initiating element according to HTML precedence rules |
| Policy differs across subdomains | Separate applications or delivery stacks use different configuration | Create a shared baseline with documented exceptions and public-response monitoring |
| API scanner expects the header on JSON | Generic web-header scoring is applied to an API endpoint | Add harmless consistency where useful, but assess the API with authentication, authorization, data, abuse, and runtime controls |
Avoid conflicting or invalid values
Send a single approved policy unless you deliberately use the documented fallback syntax. Invalid values can cause the browser default to apply, which defeats the purpose of explicit governance. Confirm the exact wire response after all proxies and edge services process it.
Do not use Referer as access control
OWASP recommends rechecking authorization on every request rather than relying on the URL, referrer, or a request flag. Use authenticated identity, object ownership, tenant boundaries, permissions, and server-side policy.
Do not confuse Referrer-Policy with CORS
The Origin request header provides origin-level security context and does not disclose a path. CORS controls whether browser scripts can read cross-origin responses; Referrer-Policy controls the amount of source-page information sent with requests. They solve different problems.
What Referrer-Policy Means for APIs
Referrer-Policy is a browser privacy control. It does not authenticate an API client, authorize an object, validate a token, detect BOLA or IDOR, prevent business logic abuse, stop enumeration, inspect response data, or identify exfiltration. A secure frontend can still call an insecure API, and a protected API can still be targeted by non-browser clients that do not follow browser referrer behavior.
Where the header matters in an API application
- Browser-rendered API portals, developer portals, admin consoles, customer dashboards, and documentation sites.
- Single-page applications that navigate to external identity, payment, support, analytics, or partner services.
- Pages whose paths or query strings contain API keys, tokens, invitation values, tenant references, object identifiers, or workflow state that should be removed.
- Embedded API explorers, iframes, scripts, images, and third-party integrations with element-level referrer policies.
- Edge-delivered error pages and redirects that may not inherit application-layer security headers.
Where separate API controls are required
Use authentication, authorization, schema validation, rate controls, behavior analytics, sensitive-data detection, request and response inspection, audit evidence, and incident response. Ammune’s REST API endpoint security guidance and API sensitive-data protection strategy cover these runtime concerns.
How Ammune Complements Referrer-Policy
Ammune can complement browser-side Referrer-Policy hardening with runtime API visibility and protection. The header controls what browsers disclose about the source page; Ammune focuses on what actually happens in live API traffic.
API discovery
Identify active domains, APIs, endpoints, versions, methods, internal services, partner routes, shadow APIs, and changes observed from runtime traffic.
Request and response context
Correlate method, route, identity, parameters, payload category, response status, response fields, data sensitivity, latency, and outcome.
Sensitive-data exposure detection
Detect PII, PCI, tokens, secrets, credentials, excessive data exposure, unusual response volume, and successful access to sensitive information.
Behavior analytics
Surface enumeration, replay, route switching, low-and-slow automation, unusual sequences, object-access anomalies, and business logic abuse.
Monitoring and safe enforcement
Begin in monitoring mode, tune high-confidence findings, and move approved controls toward alerting, rate limiting, or blocking where appropriate.
SIEM-ready evidence
Send normalized API, identity, behavior, request, response, data, action, and related-event context to security operations workflows.
Browser header versus runtime API security
| Security question | Referrer-Policy | Ammune runtime API security |
|---|---|---|
| How much source-page URL information does a browser send? | Primary control | Observes resulting traffic context when visible |
| Which APIs and endpoints are active? | Not addressed | Runtime discovery and inventory |
| Is an authenticated client enumerating objects? | Not addressed | Behavior and object-access analysis |
| Did a response expose PII, PCI, tokens, or secrets? | Not addressed | Response and data-sensitivity inspection |
| Is a business workflow being abused below a rate limit? | Not addressed | Sequence and behavior-based detection |
| Can the SOC investigate a complete API event? | Only limited browser-referrer context | SIEM-ready API evidence and forensics |
Review Ammune’s API runtime security protection platform guide, compare API security testing with runtime monitoring, and align event delivery with the centralized SIEM log-forwarding guide.
Referrer-Policy Remediation Checklist
| Check | Pass condition | Evidence |
|---|---|---|
| Policy selected | Value is based on privacy, analytics, and integration requirements | Approved architecture or security decision |
| Recommended baseline | strict-origin-when-cross-origin unless a documented exception applies | Public response header |
| Sensitive URLs | No credentials, tokens, personal data, or confidential identifiers in paths or queries | Route inventory and traffic review |
| Delivery ownership | One authoritative layer sets or overwrites the header | Origin, proxy, framework, CDN, or edge configuration |
| Response coverage | Header appears on HTML, redirects, authentication failures, and error pages | Automated route tests |
| No conflicts | No duplicate, invalid, or contradictory policy values | Raw public headers |
| Cross-origin behavior | Only the approved origin or no referrer is disclosed | Browser Network panel and controlled destination logs |
| Downgrade behavior | HTTPS-to-HTTP request omits the Referer | Controlled test |
| Element overrides | Every noreferrer or referrerpolicy override is inventoried and approved | Frontend source review |
| Analytics and integrations | Required attribution and external workflows function without unsafe URL disclosure | Product acceptance tests |
| Security scanner | Public scan recognizes the intended policy | HTTP Observatory or approved scanner result |
| API posture | Header hardening is paired with authentication, authorization, data, behavior, monitoring, and incident controls | API security architecture and runtime evidence |
Common Referrer-Policy Mistakes
- Relying only on the browser default. Send an explicit policy so the intended behavior is auditable and consistent.
- Using unsafe-url to preserve analytics. Replace implicit full-URL referral dependencies with explicit attribution.
- Putting secrets in URLs and expecting the header to solve it. Remove the sensitive values at the application design level.
- Setting the header only on the homepage. Cover authenticated pages, redirects, errors, alternate hosts, and edge-generated responses.
- Adding the value at every layer. Duplicate origin, proxy, framework, and CDN values create ambiguity and troubleshooting problems.
- Breaking a payment or identity flow without testing. Validate external redirects and embedded integrations before enforcement.
- Using Referer for authorization. It can be absent or fabricated and is not a trustworthy permission signal.
- Confusing Referrer-Policy with CORS, CSP, HSTS, or CSRF protection. Each control addresses a different browser or transport risk.
- Ignoring element-level overrides. A link, iframe, script, image, or programmatic request can intentionally apply a different policy.
- Treating an API header grade as an API security assessment. Test authorization, business logic, data exposure, abuse, and runtime behavior separately.
Conclusion
The strongest general fix for a missing secure Referrer-Policy header is to explicitly send Referrer-Policy: strict-origin-when-cross-origin, verify it on every relevant public response, remove sensitive information from URLs, test external integrations, and document any stricter or element-specific exceptions.
The header is valuable, but it addresses one browser privacy channel. Complete application and API security also requires secure transport, content controls, authentication, authorization, sensitive-data minimization, API discovery, request and response visibility, behavior analytics, SIEM integration, and rehearsed incident response. Ammune can complement the header by providing the runtime API context that browser policy alone cannot deliver.
Frequently Asked Questions
What does a missing secure Referrer-Policy header mean?
It means the response does not explicitly tell the browser how much referrer information may be included in later requests. MDN documents Referrer-Policy as the response header that controls how much information is sent in the Referer request header. Modern browsers have a privacy-oriented default, but an explicit header makes the site policy deliberate and consistent.
Is a missing Referrer-Policy header a vulnerability?
It is generally a security-hardening and privacy finding whose real risk depends on the URLs, browser clients, outgoing links, embedded resources, analytics needs, and data handled by the site. OWASP includes missing or insecure security headers within security misconfiguration, but the finding alone does not prove that sensitive data was exposed.
What is the recommended secure Referrer-Policy value?
OWASP recommends Referrer-Policy: strict-origin-when-cross-origin for a practical default that keeps the full URL for same-origin requests, sends only the origin for secure cross-origin requests, and omits the referrer on HTTPS-to-HTTP downgrades.
When should I use no-referrer instead?
Use no-referrer when the application should not send referrer information at all and the loss of referral analytics or integration context is acceptable. MDN advises selecting the strictest directive that still allows the site to function properly.
What is the difference between Referer and Referrer-Policy?
Referer is the historically misspelled request-header name, while Referrer-Policy is the correctly spelled response-header name. The policy controls what the browser is allowed to place in subsequent Referer headers.
Can Referrer-Policy prevent sensitive query-string leakage?
It can reduce what is sent to another origin, but it cannot make sensitive data safe to place in a URL. OWASP warns that sensitive data in query strings can be exposed through browser history, logs, and other channels even when HTTPS is used. Remove credentials, tokens, personal data, and confidential identifiers from URLs.
Does strict-origin-when-cross-origin break analytics?
It preserves the full referrer for same-origin requests and normally provides only the source origin for secure cross-origin requests. web.dev recommends testing analytics, logging, payment, identity, and external integration behavior before rollout because systems that depend on the complete cross-origin path or query string will lose that detail.
Can I set Referrer-Policy with an HTML meta tag?
Yes. MDN documents the meta name="referrer" element, but the HTTP response header is usually preferable because it is applied by the server or edge before the document is processed and can be governed consistently across routes.
Can a link or iframe override the site Referrer-Policy?
Yes. The HTML Standard defines precedence for noreferrer, element-level referrerpolicy attributes, meta policy, and the HTTP header. Review anchors, images, scripts, links, iframes, and fetch calls that intentionally use a different policy.
Should Referrer-Policy be added to API JSON responses?
The policy is most important on browser-rendered documents that initiate navigations and subresource requests. Mozilla notes that security-header scanning can be used on API endpoints but may not accurately represent the API security posture. Adding the header to JSON responses is usually harmless, but it does not replace API authentication, authorization, runtime monitoring, or data protection.
How do I test that Referrer-Policy is working?
Use a header-only request, browser developer tools, and controlled same-origin, cross-origin, and downgrade test pages. The curl documentation describes using -I or --head to inspect response headers, while Chrome DevTools documents viewing response and request headers in the Network panel.
How can Ammune help with Referrer-Policy and API security?
Ammune can complement secure browser headers by monitoring live API traffic, discovering endpoints, inspecting request and response context, detecting behavior anomalies, identifying sensitive-data exposure, and producing SIEM-ready evidence. Referrer-Policy reduces browser referrer disclosure; Ammune addresses runtime API behavior and data risks that a browser header cannot see.
Move from a scanner finding to an end-to-end security improvement
Define the browser policy, eliminate sensitive URL data, validate the public delivery chain, test real referrer behavior, and connect web-header hardening with runtime API discovery, data visibility, behavior detection, and SIEM-ready evidence.
