diff --git a/docs/modules/ROOT/pages/migration/servlet/exploits.adoc b/docs/modules/ROOT/pages/migration/servlet/exploits.adoc index 379c1f83ac..15e6716f6b 100644 --- a/docs/modules/ROOT/pages/migration/servlet/exploits.adoc +++ b/docs/modules/ROOT/pages/migration/servlet/exploits.adoc @@ -7,8 +7,20 @@ The following steps relate to changes around how to configure CSRF. In Spring Security 5, the default behavior is that the `CsrfToken` will be loaded on every request. This means that in a typical setup, the `HttpSession` must be read for every request even if it is unnecessary. +[NOTE] +==== +Some examples of where it should be unnecessary to read the session include endpoints marked `permitAll()` such as static assets, static HTML pages, single-page applications hosted under the same domain/server, etc. +==== + In Spring Security 6, the default is that the lookup of the `CsrfToken` will be deferred until it is needed. +[NOTE] +==== +The `CsrfToken` is needed whenever a request is made with an HTTP verb that would change the state of the application. +This is covered in detail in xref:features/exploits/csrf.adoc#csrf-protection-idempotent[Safe Methods Must be Idempotent]. +Additionally, it is needed by any request that renders the token to the response, such as a web page with a `