Disable CORS credentials by default
Access-Control-Allow-Credentials CORS header, used to allow cookies with CORS requests, is not set to true anymore by default when enabling CORS with @CrossOrigin or global CORS configuration in order to provide a more secured default CORS configuration. The related allowCredentials property now requires to be set to true explicitly in order to support cookies with CORS requests. Issue: SPR-16130
This commit is contained in:
@@ -115,9 +115,10 @@ public class CorsRegistration {
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether user credentials are supported.
|
||||
* <p>By default this is set to {@code true} in which case user credentials
|
||||
* are supported.
|
||||
* Whether user credentials are supported. Be aware that enabling this option
|
||||
* could increase the surface attack of the web application (for example via
|
||||
* exposing sensitive user-specific information like CSRF tokens).
|
||||
* <p>By default credentials are not allowed.
|
||||
*/
|
||||
public CorsRegistration allowCredentials(boolean allowCredentials) {
|
||||
this.config.setAllowCredentials(allowCredentials);
|
||||
|
||||
Reference in New Issue
Block a user