RobertoBifulco.it

  • topics
  • publications
  • il gatto
  • account
Home › Rich Client Web Applications: the future so near › Chapter III › III.1Attack Types

III.1.2Cross Site Request Forgeries (CSRF)

Roberto Bifulco — Mon, 02/11/2008 - 15:06

This attack exploits server's session management system vulnerabilities. It is based on the assumption that the mainly used mechanism to trace sessions is the use of cookies.

When you log in to a web application, this web application sets a cookie on your browser and knows that no one can access that cookie (via browser) due to the Same Origin Policy. Every time the browser make a request to that web site, it appends the cookie, so the user session is identified.

These session cookies are deleted after a period of time or when the browser is closed (or never if the web application is done very badly!). The time the cookies are not deleted is a vulnerability time if the server uses only the cookie attached to the request to identify the session.

An example: The site www.good.com provide a service to paying registered users. Roberto is a registered user and he is visiting www.good.com and in the same time he has a browser window on www.dummy.com. The latter site is done by the attacker, Antonio, to use the service of www.good.com without paying. www.dummy.com contains a script like:

<script language="javascript" src="www.good.com">
</script>


 

This way, www.dummy.com makes a request to www.good.com and, because Roberto is already authenticated there, the www.good.com's cookie is attached to the request that starts from www.dummy.com. If Antonio knows well the service offered by www.good.com he can build up a request that modify Roberto's data or much more.

SOLUTION: the solution in this case is based on a modification of the server side application, in order to make the session authentication system based on added informations and not only on the cookie. Usually the same cookie is passed as an explicit argument to the web application. This is a good solution because the cookie value can be read only from the page that sets the cookie.

Moreover, a best practice is to accept request for web application only via HTTP POST. This because even if GET is faster, a POST request is not possible by a third party page, because violates the Same Origin Policy.


 

‹ III.1.1Cross Site Scripting (XSS) up III.1.3JSON Hijacking ›
  • Printer-friendly version

nfl jerseys suppliers Fashion

Anonymous (not verified) — Mon, 01/02/2012 - 08:03

nfl jerseys suppliers Fashion brand
wholesale coach bags the trend of fashion
coach outlet Don't miss the chance it's very good
coach outlet store comfortable with it
wholesale designer handbags well known great
coach handbags outlet attractive and reasonable price
cheap coach online shopping
coach outlet store may most likely need
coach handbag outlet A good thing
authentic nfl jerseys for sale fashion designed
cheap authentic nfl jerseys together with lifestyle

  • reply

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.

Rich Client Web Applications: the future so near

  • Preface
  • Introduction
  • Chapter I
  • Chapter II
    • II.1Data serialization
    • II.2AJAX tools
  • Chapter III
    • III.1Attack Types
      • III.1.1Cross Site Scripting (XSS)
      • III.1.2Cross Site Request Forgeries (CSRF)
      • III.1.3JSON Hijacking
  • Chapter IV
    • IV.1RPC requirements
    • IV.2GJPR
  • Chapter V
    • V.1Architecture
    • V.2The polling problem
  • Bibliography
  • topics
  • publications
  • il gatto
  • account