<?xml version="1.0"?>
<rss version="2.0">
<channel>
  <title>Mark Goodwin&#039;s Blog - csrf tag</title>
  <link>http://directwebremoting.org/blog/mark/tags/csrf/</link>
  <description>Security, information, miscellanea</description>
  <language>en</language>
  <copyright>Mark Goodwin</copyright>
  <lastBuildDate>Thu, 16 Aug 2007 22:02:00 GMT</lastBuildDate>
  <generator>Pebble (http://pebble.sourceforge.net)</generator>
  <docs>http://backend.userland.com/rss</docs>
  
  
  <item>
    <title>Browser based DDOS</title>
    <link>http://directwebremoting.org/blog/mark/2007/05/17/browser_based_ddos.html</link>
    
      
        <description>
          &lt;p&gt;Everybody is saying that JavaScript is the new malware. There&#039;s an interesting application of this idea that probably hasn&#039;t occurred to many people; we&#039;ve all heard about standard CSRF and using this type of technique to perform sophisticated operations on an attacker&#039;s behalf but what about the simple stuff?&lt;/p&gt;

&lt;p&gt;I&#039;ve been working on a tool which allows you to stress test an application using scripted browser clients (like a stress test version of &lt;a href=&#034;http://www.openqa.org/selenium/&#034;&gt;Selenium&lt;/a&gt;). One of the advantages of this approach over something like, say, the Grinder is that it allows you to get a view of what real traffic from real browsers might look like. You simply set up some virtual machine images with various different browsers, point your virtual machine images at the test tool (via the target site if you want detailed client reporting or the ability to script around CSRF protection), clone your image as many times as is necessary and run them.  The test clients poll a management application to find out what they should be doing and how often and report back when they&#039;re done.&lt;/p&gt;

&lt;p&gt;The scary thing about the possibility of using this against real users is that the user of the browser needn&#039;t necessarily know that their machine has just been conscripted as part of a vast stress-testing army. You could be browsing away minding your own business whilst in the background your browser is making forged requests to DOS a website on an attacker&#039;s behalf. Because it&#039;s JavaScript based your AV won&#039;t alert you and you can patch all you like but this is possible because of a feature of browser design not a vulnerability. Your machine will forget all about it when your browser session ends, but that&#039;s no problem to the attacker if they can attract enough browsers. Jikto was aimed at breaking in - this is similar, but rather more brutal.&lt;/p&gt;

&lt;p&gt;So what&#039;s necessary from the attacker&#039;s perspective? The attacker needs to do the following:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Find some expensive functionality on the target site (preferably available to non authenticated users).&lt;/li&gt;
    &lt;li&gt;Find somewhere to host the scripts and the management application (a simple PHP script and a few lines of JavaScript would suffice for most purposes); sites vulnerable to various PHP remote file include issues are easy to come by for free hosting&lt;/li&gt;
    &lt;li&gt;Once these are in place the attacker gets people infected either by driving traffic to their scripts from a popular site, or inviting people directly (spoof e-mail from a bulk mailer perhaps)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I&#039;ve had a look around and this appears to be easier than I&#039;d initially dared imagine; people are starting to understand the need to protect functionality that makes changes to their systems or data, but I&#039;m not sure people are wise to the possibility of DDOS via CSRF. Given that this is all entirely plausible; do we need to start protecting expensive, publicly accessible functionality in our web applications with some kind of CSRF protection?&lt;/p&gt;

&lt;p&gt;Just a thought.&lt;/p&gt;
        </description>
      
      
    
    
    
    <comments>http://directwebremoting.org/blog/mark/2007/05/17/browser_based_ddos.html#comments</comments>
    <guid isPermaLink="true">http://directwebremoting.org/blog/mark/2007/05/17/browser_based_ddos.html</guid>
    <pubDate>Thu, 17 May 2007 19:49:00 GMT</pubDate>
  </item>
  
  <item>
    <title>Integrated Windows Authentication</title>
    <link>http://directwebremoting.org/blog/mark/2007/04/16/integrated_windows_authentication.html</link>
    
      
        <description>
          &lt;p&gt;
On the face of it Integrated Windows Authentication for your intranet applications (formerly known as NTLM) seems like a good deal; you can protect your users&#039; credentials without needing to set up SSL (so your credentials are safer than with basic authentication) and if you&#039;re running IIS you can turn it on with the click of a mouse.  There&#039;s the additional benefit of convenience; your users don&#039;t need to bother with interactive login as Windows makes use of user information from the current Windows session. It&#039;s like having single sign-on for all of your intranet applications.
&lt;/p&gt;
&lt;p&gt;
Unfortunately there&#039;s a catch.  The convenience that comes from the fact that users are not usually prompted to log in can extend to attackers as well as legitimate users.
&lt;/p&gt;
&lt;p&gt;
How does this work?  We&#039;re going to take a look at two different types of attack; cross site request forgery (often abbreviated to CSRF or, less commonly, XSRF) and anti dns pinning:
&lt;/p&gt;
&lt;p&gt;
CSRF:&lt;br/&gt;
This is a type of attack where an attacker crafts web content that instructs a user&#039;s browser to forge requests to another web site on the user&#039;s behalf.  Depending on how the site is crafted, the attacker may be able to perform any operation that the user would normally be able to perform, although the attacker can&#039;t read the results of the operations that have been performed.  The user will often be completely unaware that the attack is taking place. You can read more about this type of attack &lt;a href=&#034;http://en.wikipedia.org/wiki/CSRF&#034;&gt;here&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
Anti DNS pinning:&lt;br/&gt;
This is a type of attack where an attacker fools a user&#039;s browser into making connections firstly to a server under the attackers control, then servers on your local network believing they are all one and the same host; this is achieved by some trickery with DNS and some selective firewalling.  This attack is somewhat harder to understand than CSRF (you can read more about this technique &lt;a href=&#034;http://shampoo.antville.org/stories/1451301/&#034;&gt;here&lt;/a&gt;) but the key feature of this attack is that the attacker can read information from webservers on your internal network that they would not normally be able to see.
&lt;/p&gt;
&lt;p&gt;
So how does Integrated Windows Authentication relate to these types of attack? Let&#039;s say you&#039;re an attacker and you want to make use of one of these techniques to hack a company intranet.  To be able to make use of CSRF you need your user on the target network to already be authenticated to the application you&#039;re attacking; if the user is not authenticated then the forged requests will not carry the cookie or auth. header necessary for certain operations.  If you&#039;ve got Integrated Windows Authentication enabled on your server then all bets are off; the user&#039;s browser and the server will (in most cases) negotiate authentication with no interaction whatsoever from the user so, even if the user hasn&#039;t used the application at all in the current browser session, the attacker can directly hit the functionality they require.
&lt;/p&gt;
&lt;p&gt;
And what about Anti-DNS pinning?  The situation is even worse here; because the browser believes the target servers are actually in the same security domain as the attacker&#039;s server, any cookies the user may have set for the target server under it&#039;s normal name are unavailable to the attacker.  This means that under normal circumstances Anti-DNS pinning attacks can&#039;t be used for any operations that require authentication.  Again, with servers that have Integrated Windows Authentication enabled things get much easier for the attacker.  The user&#039;s browser will negotiate authentication with the server without the user&#039;s knowledge and the attacker can read any data or make any request that the user would normally have permissions for.
&lt;/p&gt;
&lt;p&gt;
Many problems in security are about finding a good balance between making life hard for attackers and making life easy for everyday users; we&#039;ve just looked at how Integrated Windows Authentication makes life rather easier for attackers than you might at first think.
&lt;/p&gt;
        </description>
      
      
    
    
    
    <comments>http://directwebremoting.org/blog/mark/2007/04/16/integrated_windows_authentication.html#comments</comments>
    <guid isPermaLink="true">http://directwebremoting.org/blog/mark/2007/04/16/integrated_windows_authentication.html</guid>
    <pubDate>Mon, 16 Apr 2007 19:54:00 GMT</pubDate>
  </item>
  
  </channel>
</rss>
