Comment 0 for bug 121408

Revision history for this message
Aaron Swartz (aaronsw) wrote :

The typical way to build a web.py application that lets users do things is to:

a) give the user a cookie to log into the site
b) present them with an HTML page with some prepared request (i.e. form or link)
c) do the action when they submit the request

The problem is that, with cross-site scripting attacks, scripts on other pages can cause the user's browser to submit the same request and, since the user already has the cookie, the request will go thru.

To prevent this, request tokens should be sent along with the request. This makes this attack more difficult, since the scripter has to grab the token and then use it to resubmit the request. (Admittedly, this doesn't seem like much of an improvement, but I might be missing something.)