I have bunch of page with HttpPost
request and I got a document from my coworker who scan my site with Acunetix
(I think). The result says HTML form without CSRF protection (9)
. The suggestion is to use Same-origin policy
by implementing Token. My question :
Token
in every POST
request? I only use Token
in sensitive POST
request like LogIn, Register, Transaction, etc.Acunetix
only list few of my pages as CSRF
possible risk when I have a lot of pages with POST
request, how does the detection pattern works?Any help will be appreciated.
Yes, you should include the ValidateAntiForgeryToken
attribute in every HttpPost... assuming you are using best practices and HttpPost means that the request has some kind of side effect.
For a long discussion on the matter, see This discussion over on IT security SE site.
It looks like Acunetix is just reporting this on each page that contains a form with no token present. See Their documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With