in reply to Is your web application really secure? ("CSRF")
A lot of websites do this already; create a token (that expires like a session-id), and that must be a parameter in the form:I do agree that embedding the session id or a token into the HTML code is currently the most secure and portable way to avoid XSRF attacks. However I regret that this takes much of the coolness and simplicity out of the concept of session cookies because they get kind of useless for POST requests. Moreover the expiration of the token or session id would render old browser windows useless.
<input type="hidden" name="t" value="123abc...">
So every action of the script that changes data should require such a token. That makes your script pretty safe.
Other ways to avoid the problem are
- Using Java script to embed the session cookie into a hidden field just before submitting
- Using the referer
However not every browser has Java script or referers turned on.
Update: If you too think that browsers should do something about the issue, please consider taking part in the discussion on Bugzilla, which you will find referenced in tinita's original posting.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Is your web application really secure? ("CSRF")
by tinita (Parson) on Apr 01, 2007 at 00:28 UTC | |
by betterworld (Curate) on Apr 01, 2007 at 03:54 UTC | |
by tinita (Parson) on Apr 02, 2007 at 09:27 UTC | |
by betterworld (Curate) on Apr 03, 2007 at 15:33 UTC |
In Section
Meditations