Skip to content

Referrer Header is set in Reactive Web Applications by default, although doc says it is not. #13561

Closed
@stefanocke

Description

@stefanocke

Describe the bug

https://docs.spring.io/spring-security/reference/reactive/exploits/headers.html#webflux-headers-referrer says:

"By default, Spring Security does not add Referrer Policy headers."

But in fact, it does for reactive applications. And the default value is "no-referrer"
Note, that this is not the case for servlet stack.

To Reproduce

  1. Create a Spring Boot App with webflux and security (as below)
  2. Start it and open it in a browser (it will show login page)
  3. In the network console of the browser, it shows "Referrer-Policy: no-referrer" in the HTTP repsonse hhaders.

Expected behavior
The behavior for reactive stack should be consistent with the documentation.
Preferrably, it should also be consistent with the behavior for servlet stack.

Sample
https://start.spring.io/#!type=maven-project&language=java&platformVersion=3.1.1&packaging=jar&jvmVersion=17&groupId=com.example&artifactId=referrerdemo&name=referrerdemo&description=Demo%20project%20for%20Spring%20Boot&packageName=com.example.referrerdemo&dependencies=webflux,security

Metadata

Metadata

Labels

in: configAn issue in spring-security-configtype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions