by sunir · 17y ago · 0 comments
The attacker, EvilPacket, recommended the wrong thing. They wrote, "The best protection I have seen so far is to use tokens that are time sensitive, tied to the user session and verified when the request is submitted back to the server."
The reason that is wrong is because the attacker can request a new token using the same method it submits a change.
Email and passwords work as challenges as they both cycle through the human being that owns the account, rather than just the browser. it's important to have more than one method that is tied to the account owner because if you want to change one, you need to use the other to confirm.
1. Attacker makes one request. I read EvilPacket to suggest the time-limited challenge is a token stuffed into the cookie. Attacker then waits a few seconds before making the change request with the token safely in the cookie.
You should rather load a challenge in the submit form. I do recommend that for user-generated content.
http://usemod.com/cgi-bin/mb.pl?EditHash
2. However, if this page is vulnerable to HTML injection, you can get the hash back by embedding Javascript that creates another iframe or img back to yourself on the attacked page. http://www.codecouch.com/2008/10/cross-site-scripting-xss-using-iframes/
So, I just find it safer to ask for the user's password.At this point, we're "discussing" something on Hacker News that even Wikipedia has right (search for "XSRF"). But if you have to think about how to handle this problem, you're doing it wrong. Use your framework's builtin XSRF protection.
If your page is vulnerable to DOM injection, you have much bigger problems than XSRF.
Also, you know DOM injection is a very common problem. It's better if you don't have to assume the website has no DOM injection problems to do the right thing.
Therefore, I think it is reasonable to recommend asking password confirmation as a general best practice, since it's a straightforward way to be the safest. I'm not sure why you are arguing with that point.