Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^3: Is your web application really secure? ("CSRF")

by betterworld (Deacon)
on Apr 01, 2007 at 03:54 UTC ( #607672=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Is your web application really secure? ("CSRF")
in thread Is your web application really secure? ("CSRF")

if i had opened a website with a form in it, let the browser window open and try to send the form the next day i would consider it ok if i then get a message that the token is expired.
If I don't lose my lengthy texts in the form, that would be all right.

But consider you have 10 tabs open, and on the next morning, you re-login in one tab, and then go through the other 9 tabs one after another to click reload. This isn't exactly fun.

Maybe the best (yet complex) solution is this: One could try to fix the expired tokens via Java script (you can read cookies with Java script). If the server still gets expired tokens (which means that Java script was not available), it could check the referer (and that the method was POST, so that no <img> attacks are possible). If there is no referer, the server can still return an error.

This would make using the site more comfortable for those users who have either Java script or referers turned on, while the site is still usable for other users.


Comment on Re^3: Is your web application really secure? ("CSRF")
Re^4: Is your web application really secure? ("CSRF")
by tinita (Parson) on Apr 02, 2007 at 09:27 UTC
    it all depends on how secure you want the application. if you're doing online-banking i think even you are glad that usually you have a timeout of 10 minutes and you can't let windows open and expect them to work an hour later =)
      Quite right. Using the approach that I described above, you can set the expiration timeout to 10 minutes and nobody will be able to waste you money online while you're absent. But the point is, that when you come back, you only need to login in one browser tab, and all the other tabs work again. Regardless of the cookie expiration timeout.

      Nevertheless, if the computer is in a room where many people wander about, you should lock the screen or something like that.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://607672]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2014-12-26 05:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (165 votes), past polls