Skip to content

Commit bf2951b

Browse files
author
Steve Riesenberg
committed
Add sections for migrating exploit protection in 6.0
Issue gh-12462
1 parent 6f5c633 commit bf2951b

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

docs/modules/ROOT/pages/migration/index.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
The Spring Security team has prepared the 5.8 release to simplify upgrading to Spring Security 6.0.
55
Use 5.8 and
66
ifdef::spring-security-version[]
7-
xref:5.8.0@migration/index.adoc[its preparation steps]
7+
xref:5.8.2@migration/index.adoc[its preparation steps]
88
endif::[]
99
ifndef::spring-security-version[]
1010
its preparation steps

docs/modules/ROOT/pages/migration/servlet/exploits.adoc

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,39 @@
11
= Exploit Protection Migrations
22

3+
The 5.8 migration guide contains several steps for
4+
ifdef::spring-security-version[]
5+
xref:5.8.2@migration/servlet/exploits.adoc[exploit protection migrations] when updating to 6.0.
6+
endif::[]
7+
ifndef::spring-security-version[]
8+
exploit protection migrations when updating to 6.0.
9+
endif::[]
10+
You are encouraged to follow those steps first.
11+
312
The following steps relate to how to finish migrating exploit protection support.
413

14+
== Defer Loading CsrfToken
15+
16+
In Spring Security 5.8, the default `CsrfTokenRequestHandler` for making the `CsrfToken` available to the application is `CsrfTokenRequestAttributeHandler`.
17+
The default for the field `csrfRequestAttributeName` is `null`, which causes the CSRF token to be loaded on every request.
18+
19+
In Spring Security 6, `csrfRequestAttributeName` defaults to `_csrf`.
20+
If you configured the following only for the purpose of updating to 6.0, you can now remove it:
21+
22+
requestHandler.setCsrfRequestAttributeName("_csrf");
23+
24+
== Protect against CSRF BREACH
25+
26+
In Spring Security 5.8, the default `CsrfTokenRequestHandler` for making the `CsrfToken` available to the application is `CsrfTokenRequestAttributeHandler`.
27+
`XorCsrfTokenRequestAttributeHandler` was added to allow opting into CSRF BREACH support.
28+
29+
In Spring Security 6, `XorCsrfTokenRequestAttributeHandler` is the default `CsrfTokenRequestHandler` for making the `CsrfToken` available.
30+
If you configured the `XorCsrfTokenRequestAttributeHandler` only for the purpose of updating to 6.0, you can remove it completely.
31+
32+
[NOTE]
33+
====
34+
If you have set the `csrfRequestAttributeName` to `null` in order to opt out of deferred tokens, or if you have configured a `CsrfTokenRequestHandler` for any other reason, you can leave the configuration in place.
35+
====
36+
537
== CSRF BREACH with WebSocket support
638

739
In Spring Security 5.8, the default `ChannelInterceptor` for making the `CsrfToken` available with xref:servlet/integrations/websocket.adoc[WebSocket Security] is `CsrfChannelInterceptor`.

0 commit comments

Comments
 (0)