Strange behavior of CSRF tokens with a low csrf_expire (3.1.2) |
(01-27-2017, 06:58 AM)spjonez Wrote: What am I looking for? Here's screenshots of the cookie's for the request to /token and the 403 that happens immediately upon using said token. These images don't show the csrf_cookie value - that's what you had to look for. (01-27-2017, 06:58 AM)spjonez Wrote: Found the issue. All the requests I was sending were POST. My browser cookie was not being updated because of this line: Well, no ... actually because of a bug that was fixed in 3.1.3, which also contains a lot of other security patches. You should've updated first. (01-27-2017, 06:58 AM)spjonez Wrote: Out of curiosity, you mentioned you thought this approach was a bad idea. Do you have an alternative solution where the user will never see a 403 error unless they are doing something they shouldn't be? Not just the approach, the entire idea is bad. Knowingly submitting a request that you know will fail is obviously bad, but while tracking the token by expiry time would be more clean, it is still not a bullet-proof approach. In any case, whatever you do will amount to the same effect as setting a huge expiry time. But the real problem is that you're going out of your way to disable a security feature. Often overlooked, but CSRF also prevents against replay attacks, and against someone physically impersonating careless users who leave their browsers open. What you're trying to do nullifies those protections and you'll now always refill the form with a valid token. |
Messages In This Thread |
Strange behavior of CSRF tokens with a low csrf_expire (3.1.2) - by spjonez - 01-26-2017, 01:06 PM
RE: Strange behavior of CSRF tokens with a low csrf_expire - by Narf - 01-26-2017, 01:46 PM
RE: Strange behavior of CSRF tokens with a low csrf_expire (3.1.2) - by spjonez - 01-27-2017, 06:58 AM
RE: Strange behavior of CSRF tokens with a low csrf_expire (3.1.2) - by Narf - 01-27-2017, 08:40 AM
RE: Strange behavior of CSRF tokens with a low csrf_expire (3.1.2) - by spjonez - 01-27-2017, 09:02 AM
RE: Strange behavior of CSRF tokens with a low csrf_expire (3.1.2) - by Narf - 01-27-2017, 11:11 AM
RE: Strange behavior of CSRF tokens with a low csrf_expire (3.1.2) - by spjonez - 01-27-2017, 11:42 AM
|