Sessions are much safer than, say, cookies. But you can still steal the session, and thus, the hacker will have full access to what is in this session. Some ways to avoid this are IP checking (which works very well, but the fi value is very low and therefore not reliable in itself) and using nonce. Typically, with nonce, you have a โtokenโ for each page, so that each page checks that the last page does not match what it stored.
There is a loss of convenience in any security audit. If you are checking IP addresses and the user is behind an intranet firewall (or any other situation that causes this) that does not support a fixed IP address for that user, they will have to re-authenticate each time they lose their IP address . With nonce, you always enjoy the โClick Backโ overload.
But with cookies, a hacker can steal a session simply by using fairly simple XSS methods. If you store the user session ID as a cookie, they are also vulnerable to this. Thus, even though the session is only permeable to those who can perform hacking at the server level (which requires a much more complex method and usually some privileges if your server is secure), you still need some additional level Checks for every script request. You should not use cookies and AJAX together, as this facilitates a complete move to the city if this cookie is stolen, since your ajax requests may not receive security checks for each request. For example, if a page uses nonce, but the page never reloads, the script can only check for this match. And if the cookie supports the authentication method, I can now go to the city, doing my evil, using the stolen cookie and the AJAX hole.
Anthony Jul 25 '09 at 3:54 2009-07-25 03:54
source share