spring - How to know if my CSRF is working? -
i trying implement csrf using spring , freemarker template.
due restrictions of freemarker had add javascript function make work, saw here:
so, added code:
$(function () { var token = $("meta[name='_csrf']").attr("content"); var header = $("meta[name='_csrf_header']").attr("content"); $(document).ajaxsend(function(e, xhr, options) { xhr.setrequestheader(header, token); }); });
as far see, not adding anything, metatags no content... , ajaxsend cannot 100% sure working, there way know working?
i read default csrf enabled. , have correct chain filters (as far check).
i using spring 3.2.8 , security 3.2.5 freemarker 2.3.2
is there way verify this?
thanks
if want check csrf filter preventing malicious requests, use tool firefox-plugin "tamper-data" able manipulate request before send. such tool can delete or change sended csrf-prevention token. -- when change or delete it, server must repsond error (not authorized or that) -- if server full fill request normal, crsf protection not working.
Comments
Post a Comment