In a discussion titled ‘Harden Referrer-Policy Header’, hellekin proposed making Referrer-Policy: strict-origin-when-cross-origin the default header, noting that the current setup duplicates headers — one from Rails (strict-origin-when-cross-origin) and another from Discourse’s nginx config (no-referrer-when-downgrade). hellekin suggested removing the redundant nginx line, as strict-origin-when-cross-origin is a superset and more secure. xrav3nz confirmed the duplicate header originates from Rails, not recent CSP changes. sam agreed and promptly removed the redundant line from Discourse’s nginx config in this commit. hellekin reminded sam to update discourse_docker as well, which sam did here. codinghorror praised the find, calling it ‘excellent’. The change simplifies configuration and aligns with modern security best practices by eliminating redundancy and adopting a stricter default policy.
Make Referrer-Policy: strict-origin-when-cross-origin the default header.
Please change the default Referrer-Policy header to strict-origin-when-cross-origin that also covers the use-case of no-referrer-when-downgrade but works for e.g., comments embedding.
… show that “There was a duplicate Referrer-Policy header.”
Referrer-Policy strict-origin-when-cross-origin
Referrer-Policy no-referrer-when-downgrade
Only one of those should be set. 1 is not referenced in Discourse’s code, but it seems to me the legitimate one to use since it acts as a superset of 2. 2 is referenced in the sample nginx configuration file at