I have a CSRF protected application provided by apache modules. My application contains several pages that allow you to download some files, it looks like this:
<form:form method="post" action="my.controller" enctype="multipart/form-data" id="form">
All things worked fine when we upgraded our version of apache from httpd-2.2.3 to httpd-2.2.15 .
I searched for a while and found that the problem could be related to the multipart / form-data strong> parameter in my form. In this case, the form is submitted as unsecured. I also found that spring can handle things as above using MultipartFilter from spring doc http://docs.spring.io/spring-security/site/docs/3.2.0.CI-SNAPSHOT/reference/html/ csrf.html # csrf-multipartfilter
I am new to CSRF. It would be nice to know that you can use spring CSRF protection with apache configuration to handle such cases.
I also found a workaround where I can disable CSRF for the necessary URLs, for example
RewriteRule / url / mycontroller.controller - [E = CSRF_IGNORE: yes]
But I'm not sure if this will be correct.
source share