Using proper HTTP verbs
The first step to protecting against CSRF attacks is to ensure your website uses proper HTTP verbs. Specifically, before Spring Security's CSRF support can be of use, you need to be certain that your application is using PATCH, POST, PUT, and/or DELETE for anything that modifies state.
This is not a limitation of Spring Security's support, but instead a general requirement for proper CSRF prevention. The reason is that including private information in an HTTP GET method can cause the information to be leaked.
Refer to RFC 2616, Section 15.1.3, Encoding Sensitive Information in URI's for general guidance on using POST instead of GET for sensitive information (https://www.w3.org/Protocols/rfc2616/rfc2616-sec15.html#sec15.1.3 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access