|
|||||||||||
|
RE: Custom session tokens and XSS
From: Rob Morhaime <RobM(at)nexcura.com>
Date: Tue Aug 12 2003 - 17:02:50 EDT
Simple Example:
2) attacker quickly creates a web page/email including a form with the _valid_ token in the hidden form field. The action on the form points to the vulnerable website. The form also includes a bit of XSS. 3) attacker lures victim into submitting the form. The victim is not redirected to login because token is valid, thus XSS has an opportunity to do it's dirty work. -Rob
-----Original Message-----
Several locations within the authenticated areas of the application exhibited XSS-like behaviour (i.e. client data submitted in form and URL querystring fields is returned unsanitised to the browser). However (as far as I could see) there was no way to exploit this to attack other users. Any request not containing a valid session token results in a redirect to the login page. And so assuming that only the user knows their own session token, only they could frame a malicious request that would succeed in injecting arbitrary HTML/JavaScript into their browser. The relevant difference from conventional session tokens (cookies) is that the custom token is not automatically stored and resubmitted by the browser as the user moves between pages. Rather, the browser only submits the token with any given request because the application has set the token within the form that generates that request. If the user initiates an arbitrary request (induced by an attacker) then it will not contain a valid token, and they are returned to the login page. Although the developers had chosen this means of maintaining session state for different reasons (to do with load-balancing across multiple web servers), it effectively reduces both the scope and impact of any XSS vulnerabilities:
Of course, there may be downsides to this approach to session management, and I wouldn't recommend it without question, but I think it's worthy of consideration. Any thoughts? PortSwigger Received on Tue Aug 12 18:21:25 2003 This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 14:07:54 EDT |
||||||||||
|
|||||||||||