I have a question about Django CsrfViewMiddleware mechanism. I know, that Django:
- Set new csrftoken cookie on every request.
- Check, than X-CSRFToken header value (or hidden input "csrfmiddlewaretoken") must be equals to csrftoken cookie.
But Django doesn't check whether token has been used already (example from CsrfViewMiddleware):
if not constant_time_compare(request_csrf_token, csrf_token):
return self._reject(request, REASON_BAD_TOKEN)
So I can POST multiple requests with the same token (I tested it on my server).
Is it standart behavior, or I have incorrect Django setup? Thanks.