You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/migration/servlet/exploits.adoc
+62Lines changed: 62 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -243,3 +243,65 @@ open fun springSecurity(http: HttpSecurity): SecurityFilterChain {
243
243
==== I need to opt out of CSRF BREACH protection for another reason
244
244
245
245
If CSRF BREACH protection does not work for you for another reason, you can opt out using the configuration from the <<servlet-opt-in-defer-loading-csrf-token>> section.
246
+
247
+
== CSRF BREACH with WebSocket support
248
+
249
+
If the steps for <<Protect against CSRF BREACH>> work for normal HTTP requests and you are using xref:servlet/integrations/websocket.adoc[WebSocket Security] support, then you can also opt into Spring Security 6's default support for BREACH protection of the `CsrfToken` with xref:servlet/integrations/websocket.adoc#websocket-sameorigin-csrf[Stomp headers].
250
+
251
+
.WebSocket Security BREACH Protection
252
+
====
253
+
.Java
254
+
[source,java,role="primary"]
255
+
----
256
+
@Bean
257
+
ChannelInterceptor csrfChannelInterceptor() {
258
+
return new XorCsrfChannelInterceptor();
259
+
}
260
+
----
261
+
262
+
.Kotlin
263
+
[source,kotlin,role="secondary"]
264
+
----
265
+
@Bean
266
+
open fun csrfChannelInterceptor(): ChannelInterceptor {
0 commit comments