<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:thr="http://purl.org/syndication/thread/1.0">
    <title>IBM Application Security Insider</title>
    
    
    <link rel="alternate" type="text/html" href="http://blog.watchfire.com/wfblog/" />
    <id>tag:typepad.com,2003:weblog-1300270</id>
    <updated>2012-05-17T20:51:07+03:00</updated>
    <subtitle>The IBM Application Security Insider is a blog devoted to dissecting today’s latest industry trends, observations and evolving threats in the growing web application security industry.

The IBM AppScan portfolio provides web application security and compliance solutions that pinpoint vulnerabilities and helps manage the process of fixing them.</subtitle>
    <generator uri="http://www.typepad.com/">TypePad</generator>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/WatchfireApplicationSecurityInsider" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="watchfireapplicationsecurityinsider" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://hubbub.api.typepad.com/" /><entry>
        <title>Enhancing Web Application Security Testing with IBM Security AppScan Glass Box</title>
        <link rel="alternate" type="text/html" href="http://blog.watchfire.com/wfblog/2012/05/enhancing-web-application-security-testing-with-ibm-security-appscan-glass-box.html" />
        <link rel="replies" type="text/html" href="http://blog.watchfire.com/wfblog/2012/05/enhancing-web-application-security-testing-with-ibm-security-appscan-glass-box.html" thr:count="0" />
        <id>tag:typepad.com,2003:post-6a00d835130c5153ef016766912a32970b</id>
        <published>2012-05-17T20:51:07+03:00</published>
        <updated>2012-05-17T20:52:13+03:00</updated>
        <summary>I have already blogged about AppScan's Glass box (IAST / Runtime Analysis) capabilities a while ago, but I've recently recorded a short demonstration of how to install and run a Glass box scan with IBM Security AppScan Standard. Here's the...</summary>
        <author>
            <name>IBM Application Security Insider</name>
        </author>
        
        
<content type="html" xml:lang="en-US" xml:base="http://blog.watchfire.com/wfblog/">&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;p style="text-align: left;"&gt;I have already &lt;a href="http://blog.watchfire.com/wfblog/2011/11/through-the-looking-glass.html" target="_blank"&gt;blogged&lt;/a&gt; about AppScan's Glass box (IAST / Runtime Analysis) capabilities a while ago, but I've recently recorded a short demonstration of how to install and run a Glass box scan with IBM Security AppScan Standard.&lt;/p&gt;&#xD;
&lt;p style="text-align: left;"&gt;Here's the Youtube movie (don't forget to watch it in 720p/HD, full screen)&lt;/p&gt;&#xD;
&lt;p style="text-align: center;"&gt;&lt;iframe frameborder="0" height="281" src="http://www.youtube.com/embed/DOqf4vx0glE?fs=1&amp;amp;feature=oembed" width="500"&gt;&lt;/iframe&gt; &lt;/p&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/WatchfireApplicationSecurityInsider?a=z1rYYA0w0fw:kIg4QEtN1ZA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WatchfireApplicationSecurityInsider?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WatchfireApplicationSecurityInsider?a=z1rYYA0w0fw:kIg4QEtN1ZA:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WatchfireApplicationSecurityInsider?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WatchfireApplicationSecurityInsider?a=z1rYYA0w0fw:kIg4QEtN1ZA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WatchfireApplicationSecurityInsider?i=z1rYYA0w0fw:kIg4QEtN1ZA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WatchfireApplicationSecurityInsider/~4/z1rYYA0w0fw" height="1" width="1"/&gt;</content>



    </entry>
    <entry>
        <title>Android SQLite Journal Information Disclosure (CVE-2011-3901)</title>
        <link rel="alternate" type="text/html" href="http://blog.watchfire.com/wfblog/2012/05/android-sqlite-journal-information-disclosure-cve-2011-3901.html" />
        <link rel="replies" type="text/html" href="http://blog.watchfire.com/wfblog/2012/05/android-sqlite-journal-information-disclosure-cve-2011-3901.html" thr:count="0" />
        <id>tag:typepad.com,2003:post-6a00d835130c5153ef016304ed7bfe970d</id>
        <published>2012-05-03T14:06:29+03:00</published>
        <updated>2012-05-17T20:53:08+03:00</updated>
        <summary>Recently we detected a security vulnerability in Android’s SQLite engine which can be exploited by a non-privileged application in order to disclose sensitive information. It enables a malicious application to eavesdrop on database activities performed by any other application using...</summary>
        <author>
            <name>Roee Hay</name>
        </author>
        
        
<content type="html" xml:lang="en-US" xml:base="http://blog.watchfire.com/wfblog/">&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;p&gt;Recently we detected a security vulnerability in Android’s SQLite engine which can be exploited by a non-privileged application in order to disclose sensitive information. It enables a malicious application to eavesdrop on database activities performed by any other application using SQLite, allowing unauthorized access to information such as URL history, messages, and contacts.&lt;/p&gt;&#xD;
&lt;p&gt;The complete advisory can be found &lt;a href="http://bit.ly/K0W0pT" target="_self"&gt;here&lt;/a&gt;.&lt;/p&gt;&#xD;
&lt;p style="text-align: left;"&gt;Demo of the PoC:&lt;/p&gt;&#xD;
&lt;p style="text-align: center;"&gt;&lt;iframe frameborder="0" height="315" src="http://www.youtube.com/embed/oCXLHjmH5rY" width="420"&gt;&lt;/iframe&gt;&lt;/p&gt;&#xD;
&lt;p&gt; &lt;/p&gt;&#xD;
&lt;p&gt;We would like to thank the Android Security Team for the efficient and quick way in which they handled this security issue.&lt;/p&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/WatchfireApplicationSecurityInsider?a=lAyyVGVQw20:wBQ4tq-Vrl8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WatchfireApplicationSecurityInsider?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WatchfireApplicationSecurityInsider?a=lAyyVGVQw20:wBQ4tq-Vrl8:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WatchfireApplicationSecurityInsider?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WatchfireApplicationSecurityInsider?a=lAyyVGVQw20:wBQ4tq-Vrl8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WatchfireApplicationSecurityInsider?i=lAyyVGVQw20:wBQ4tq-Vrl8:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WatchfireApplicationSecurityInsider/~4/lAyyVGVQw20" height="1" width="1"/&gt;</content>



    </entry>
    <entry>
        <title>Handling Complex Scenarios with AppScan's Custom Parameters</title>
        <link rel="alternate" type="text/html" href="http://blog.watchfire.com/wfblog/2012/04/handling-complex-scenarios-with-appscans-custom-parameters.html" />
        <link rel="replies" type="text/html" href="http://blog.watchfire.com/wfblog/2012/04/handling-complex-scenarios-with-appscans-custom-parameters.html" thr:count="0" />
        <id>tag:typepad.com,2003:post-6a00d835130c5153ef016304f72933970d</id>
        <published>2012-04-30T11:55:53+03:00</published>
        <updated>2012-04-30T11:55:53+03:00</updated>
        <summary>If you are familiar with web technologies, either from assessing them for security, or from developing them, you are probably aware of the many innovative ways developers choose to implement web applications. The days of following the HTTP RFC are...</summary>
        <author>
            <name>IBM Application Security Insider</name>
        </author>
        <category scheme="http://www.sixapart.com/ns/types#category" term="Info Bits" />
        <category scheme="http://www.sixapart.com/ns/types#category" term="Web Application Scanners" />
        <category scheme="http://www.sixapart.com/ns/types#category" term="Weblogs" />
        
        
<content type="html" xml:lang="en-US" xml:base="http://blog.watchfire.com/wfblog/">&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;p&gt;If you are familiar with web technologies, either from assessing them for security, or from developing them, you are probably aware of the many innovative ways developers choose to implement web applications. The days of following the &lt;a href="http://www.w3.org/Protocols/rfc2616/rfc2616.html" target="_blank"&gt;HTTP RFC&lt;/a&gt; are long gone - developers do whatever they need to do, in order to make things work.&lt;/p&gt;&#xD;
&lt;p&gt;For example, HTTP Parameters are passed as a part of the URL (e.g. REST), tokens are passed as HTTP headers (e.g. CSRF protection) instead of as cookies or parameters, parameter values are concatenated with weird strings instead of ampersand (&amp;amp;), XML islands inside HTTP request body, JSON, etc.&lt;/p&gt;&#xD;
&lt;p&gt;The task of writing a good, robust and thorough web crawler is almost impossible these days - unless you take into consideration the fact that by the time you finish writing your parser, you'll have to add support for new technologies and new web development paradigms.&lt;/p&gt;&#xD;
&lt;p&gt;What I'm trying to say is that if you're trying to write a good web crawler, you better find a way to enhance it on the fly, and do so in a simple manner, so your users will be able to figure it out.&lt;/p&gt;&#xD;
&lt;p&gt;That's exactly what we've done with AppScan Standard's "Custom Parameters" definition. This capability, which I have already blogged about when I discussed testing of &lt;a href="http://blog.watchfire.com/wfblog/2012/01/testing-restful-services-with-appscan-standard.html" target="_blank"&gt;RESTful services&lt;/a&gt; with AppScan Standard, allows AppScan Standard users to augment AppScan's HTTP parser capabilities, in almost endless ways. &lt;/p&gt;&#xD;
&lt;p&gt;The "Custom Parameters" definition, enables an AppScan user to teach AppScan how to extract non-standard parameter structures from HTTP traffic. In addition, once you define such a parameter, you can apply a set of rules specifically for that parameter (or parameter group) - for example, should it be tested? should it be tracked? from the login sequence, or whenever a new value is set by the application, and so forth.&lt;/p&gt;&#xD;
&lt;p&gt;The definition itself is done using regular expressions, which are extremely powerful. You can define where the parameter is located in the HTTP request, if it has a parameter-name, or perhaps only a value, how parameter name/value pairs are concatenated, etc. - it is truly the ultimate way to extend AppScan's HTTP parser to support the most bizarre scenarios.&lt;/p&gt;&#xD;
&lt;p&gt;And why am I suddenly bringing this up?&lt;/p&gt;&#xD;
&lt;p&gt;A few days ago, there was an &lt;a href="http://blog.denimgroup.com/denim_group/2012/04/automated-application-scanning-handling-complicated-logins-with-appscan-and-burp-suite.html" target="_blank"&gt;interesting discussion&lt;/a&gt; going on over at Twitter (originally raised by &lt;a href="https://twitter.com/#!/danielcornell" target="_blank"&gt;Dan Cornell&lt;/a&gt; from the Denim Group), and in a &lt;a href="http://diniscruz.blogspot.com/2012/04/small-step-for-appsec-large-step-for.html" target="_blank"&gt;few blogs&lt;/a&gt;, about a complex login scenario, which AppScan supposedly required help from &lt;a href="http://www.portswigger.net/burp/proxy.html" target="_blank"&gt;Burp proxy&lt;/a&gt;. At some point, it was decided that AppScan failed. In reality, all that was needed from AppScan to support that complex login, was a simple "Custom Parameter" configuration.&lt;/p&gt;&#xD;
&lt;p&gt;Once I submitted the sample configuration back to Dan (which was contributed by our own Paul Ionescu - a true AppScan expert), he kindly &lt;a href="http://blog.denimgroup.com/denim_group/2012/04/automated-application-scanning-handling-complicated-logins-with-appscan-only.html" target="_blank"&gt;posted the solution on his blog&lt;/a&gt;, and the situation now is that AppScan is currently the only scanner with a validated solution. &lt;/p&gt;&#xD;
&lt;p&gt; &lt;/p&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/WatchfireApplicationSecurityInsider?a=PJm-G-Euc8Y:4Ff5rVwRQek:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WatchfireApplicationSecurityInsider?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WatchfireApplicationSecurityInsider?a=PJm-G-Euc8Y:4Ff5rVwRQek:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WatchfireApplicationSecurityInsider?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WatchfireApplicationSecurityInsider?a=PJm-G-Euc8Y:4Ff5rVwRQek:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WatchfireApplicationSecurityInsider?i=PJm-G-Euc8Y:4Ff5rVwRQek:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WatchfireApplicationSecurityInsider/~4/PJm-G-Euc8Y" height="1" width="1"/&gt;</content>



    </entry>
    <entry>
        <title>Microsoft Anti-XSS Library Bypass (MS12-007)</title>
        <link rel="alternate" type="text/html" href="http://blog.watchfire.com/wfblog/2012/01/microsoft-anti-xss-library-bypass.html" />
        <link rel="replies" type="text/html" href="http://blog.watchfire.com/wfblog/2012/01/microsoft-anti-xss-library-bypass.html" thr:count="2" thr:updated="2012-02-26T10:02:57+02:00" />
        <id>tag:typepad.com,2003:post-6a00d835130c5153ef0168e5c92ecf970c</id>
        <published>2012-01-19T11:27:01+02:00</published>
        <updated>2012-02-21T10:42:37+02:00</updated>
        <summary>Introduction: Microsoft Anti-XSS Library is used to protect applications from Cross-Site Scripting attacks, by providing methods for input sanitization. Vulnerability: Microsoft Anti-XSS Library 3.0 and 4.0 are vulnerable to an attack in which an attacker is able to create a...</summary>
        <author>
            <name>Adi Cohen</name>
        </author>
        
        
<content type="html" xml:lang="en-US" xml:base="http://blog.watchfire.com/wfblog/">&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;p&gt;&lt;strong&gt;Introduction:&lt;/strong&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;a name="OLE_LINK4"&gt;&lt;/a&gt;Microsoft Anti-XSS Library is used to protect applications from Cross-Site Scripting attacks, by providing methods for input sanitization.&lt;/p&gt;&#xD;
&lt;p&gt;&lt;strong&gt;Vulnerability:&lt;/strong&gt;&lt;/p&gt;&#xD;
&lt;p&gt;Microsoft Anti-XSS Library 3.0 and 4.0 are vulnerable to an attack in which an attacker is able to create a specially formed CSS, that after passing through the &lt;strong&gt;GetSafeHTML&lt;/strong&gt; or &lt;strong&gt;GetSafeHTMLFragment&lt;/strong&gt; methods, contains an expression that triggers a JavaScript call in Internet Explorer.&lt;/p&gt;&#xD;
&lt;p&gt;The following ASP.NET code demonstrates the vulnerability:&lt;/p&gt;&#xD;
&lt;p style="text-align: left;"&gt;&lt;span style="font-family: 'courier new', courier;"&gt;1. string data = Microsoft.Security.Application.Sanitizer.GetSafeHtml("&amp;lt;html&amp;gt;a&amp;lt;style&amp;gt;&amp;lt;!--div{font-family:Foo,Bar\\,'a\\a';font-family:';color:expression(alert(1));y'}--&amp;gt;&amp;lt;/style&amp;gt;&amp;lt;div&amp;gt;b&amp;lt;/div&amp;gt;&amp;lt;/html&amp;gt;");&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p style="text-align: left;"&gt;&lt;span style="font-family: 'courier new', courier;"&gt;2. string data = Microsoft.Security.Application.Sanitizer.GetSafeHtmlFragment("&amp;lt;div style=\"font-family:Foo,Bar\\,'a\\a';font-family:';color:expression(alert(1));y'\"&amp;gt;aaa&amp;lt;/div&amp;gt;");&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p style="text-align: left;"&gt;&lt;strong&gt;Explanation:&lt;/strong&gt;&lt;/p&gt;&#xD;
&lt;p&gt;The string value can be broken down as follows:&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-family: 'courier new', courier;"&gt;div{&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-family: 'courier new', courier;"&gt;&lt;span style="color: #0000ff;"&gt;font-family&lt;/span&gt;:Foo,Bar\,'a\a';&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-family: 'courier new', courier;"&gt;&lt;span style="color: #0000ff;"&gt;font-family&lt;/span&gt;:';color:expression(alert(1));y'&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-family: 'courier new', courier;"&gt;}&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;A bug in the Anti-XSS library causes the closing apostrophe in the first CSS rule to be dropped. Because of the string not being properly terminated, Internet Explorer now renders this CSS in a different way, which triggers a javascript call:&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-family: 'courier new', courier;"&gt;div{&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-family: 'courier new', courier;"&gt;&lt;span style="color: #0000ff;"&gt;font-family&lt;/span&gt;:Foo,Bar\,'a\a;font-family:';&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-family: 'courier new', courier;"&gt;&lt;span style="color: #0000ff;"&gt;color&lt;/span&gt;:expression(alert(1));&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="color: #0000ff; font-family: 'courier new', courier;"&gt;y'&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-family: 'courier new', courier;"&gt;}&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;strong&gt;Impact:&lt;/strong&gt;&lt;/p&gt;&#xD;
&lt;p&gt;Every application that relies on either &lt;strong&gt;&lt;em&gt;GetSafeHTML&lt;/em&gt;&lt;/strong&gt; or &lt;strong&gt;&lt;em&gt;GetSafeHtmlFragment&lt;/em&gt;&lt;/strong&gt; to sanitize user supplied data is vulnerable to XSS.&lt;/p&gt;&#xD;
&lt;p&gt;&lt;strong&gt;Remediation:&lt;/strong&gt;&lt;/p&gt;&#xD;
&lt;p&gt;Microsoft has issued a the &lt;a href="http://www.microsoft.com/download/en/details.aspx?id=28589" target="_self" title="Anti-XSS library 4.2"&gt;Anti-XSS library 4.2&lt;/a&gt; to address this issue.&lt;/p&gt;&#xD;
&lt;p&gt;&lt;strong&gt;References:&lt;/strong&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;a href="http://www.securityfocus.com/bid/51291"&gt;http://www.securityfocus.com/bid/51291&lt;/a&gt; &lt;br&gt;&lt;a href="http://technet.microsoft.com/en-us/security/bulletin/ms12-007"&gt;http://technet.microsoft.com/en-us/security/bulletin/ms12-007&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/WatchfireApplicationSecurityInsider?a=-MD7utY2vvw:3SdxNheqOf8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WatchfireApplicationSecurityInsider?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WatchfireApplicationSecurityInsider?a=-MD7utY2vvw:3SdxNheqOf8:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WatchfireApplicationSecurityInsider?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WatchfireApplicationSecurityInsider?a=-MD7utY2vvw:3SdxNheqOf8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WatchfireApplicationSecurityInsider?i=-MD7utY2vvw:3SdxNheqOf8:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WatchfireApplicationSecurityInsider/~4/-MD7utY2vvw" height="1" width="1"/&gt;</content>



    </entry>
    <entry>
        <title>Testing RESTful Services with AppScan Standard</title>
        <link rel="alternate" type="text/html" href="http://blog.watchfire.com/wfblog/2012/01/testing-restful-services-with-appscan-standard.html" />
        <link rel="replies" type="text/html" href="http://blog.watchfire.com/wfblog/2012/01/testing-restful-services-with-appscan-standard.html" thr:count="2" thr:updated="2012-03-12T11:39:08+02:00" />
        <id>tag:typepad.com,2003:post-6a00d835130c5153ef0168e5907c21970c</id>
        <published>2012-01-15T13:36:09+02:00</published>
        <updated>2012-01-15T13:36:09+02:00</updated>
        <summary>As much as I love SOAP web services (not!), it seems like RESTful web services really caught on and became a de-facto standard these days – you see them everywhere, in the cloud, in AJAX or Web 2.0 applications, mobile...</summary>
        <author>
            <name>IBM Application Security Insider</name>
        </author>
        <category scheme="http://www.sixapart.com/ns/types#category" term="Info Bits" />
        <category scheme="http://www.sixapart.com/ns/types#category" term="Web Application Scanners" />
        
        
<content type="html" xml:lang="en-US" xml:base="http://blog.watchfire.com/wfblog/">&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;p&gt;As much as I love SOAP web services (not!), it seems like RESTful web services really caught on and became a de-facto standard these days – you see them everywhere, in the cloud, in AJAX or Web 2.0 applications, mobile applications and so forth.&lt;/p&gt;&#xD;
&lt;p&gt;Unlike SOAP services, RESTful services are lightweight. They are extremely easy to understand and also to develop. Nevertheless, there seem to be a million different definitions as to what they really are, but I think the simplest way to understand them is by using the following four definitions, which I’ve found in this &lt;a href="http://www.ibm.com/developerworks/webservices/library/ws-restful/" target="_blank"&gt;DeveloperWorks article&lt;/a&gt;:&lt;/p&gt;&#xD;
&lt;ol&gt;&#xD;
&lt;li&gt;RESTful services use HTTP methods explicitly&lt;/li&gt;&#xD;
&lt;li&gt;RESTful services are stateless&lt;/li&gt;&#xD;
&lt;li&gt;RESTful services expose directory structure-like URIs&lt;/li&gt;&#xD;
&lt;li&gt;RESTful services transfer XML, JSON or both&lt;/li&gt;&#xD;
&lt;/ol&gt;&#xD;
&lt;p&gt;Simple right?&lt;/p&gt;&#xD;
&lt;p&gt;As much as RESTful services are simple for humans to understand, they are actually a nightmare for automated web application scanners. Why? Because classic HTTP requests usually include parameters either in the Query or Body part of the request. On the other hand, RESTful services usually pass them as what looks like directories (see rule #3 above). For example – the following HTTP request will return the details for a user named Bob:&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-family: 'courier new', courier; font-size: 10pt;"&gt;GET /data/users/Bob/ HTTP/1.1&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-family: 'courier new', courier; font-size: 10pt;"&gt;Host: &lt;a href="http://www.some.site/"&gt;www.some.site&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-family: 'courier new', courier; font-size: 10pt;"&gt;&lt;a href="http://www.some.site/"&gt;&lt;/a&gt;Connection: close&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt; &lt;/p&gt;&#xD;
&lt;p&gt;If this was a standard HTTP request, I would tell you that there’s a good chance you’re looking at a web server that contains 3 directories under its virtual root /data/, /users/, and /Bob/, but that’s not the case. This request, tells the RESTful service to retrieve (GET) the account information for user Bob, which is a part of the /users/ list in our data repository.&lt;/p&gt;&#xD;
&lt;p&gt;When an automated scanner crawls the web application, there’s a good chance that out-of-the-box, it won’t figure out that we’re looking at a RESTful service here, and it will consider these parts of the URL as directories. This means a few things:&lt;/p&gt;&#xD;
&lt;ul&gt;&#xD;
&lt;li&gt;Directory-level tests will be sent to the wrong places – potential false positives&lt;/li&gt;&#xD;
&lt;li&gt;Parameter-level tests will not be sent to the right places – potential false negatives&lt;/li&gt;&#xD;
&lt;/ul&gt;&#xD;
&lt;p&gt;IBM's AppScan Standard enables you to train it to cope with RESTful services, using one of two options – Manual or Automatic configuration. Let’s start with the manual option.&lt;/p&gt;&#xD;
&lt;h3&gt;Custom Parameters&lt;/h3&gt;&#xD;
&lt;p&gt;By default, AppScan automatically recognizes parameters in standard HTTP &amp;amp; HTML formats, but if parameters are in other formats (for example within the Path or within another parameter), you need to define them manually, so that AppScan would be able to recognize, follow and manipulate them during scanning. This is done from the Custom Parameters definition, which you can find under &lt;strong&gt;Scan Configuration -&amp;gt; Parameters and Cookies -&amp;gt; Advanced: Customer Parameters&lt;/strong&gt;.&lt;/p&gt;&#xD;
&lt;p&gt;In order to create a new type of custom parameter definition, you have to click the “+” button, which opens the following screen:&lt;/p&gt;&#xD;
&lt;p&gt;&lt;a href="http://blog.watchfire.com/.a/6a00d835130c5153ef0167608f94fe970b-popup" onclick="window.open( this.href, '_blank', 'width=640,height=480,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0' ); return false" style="display: inline;"&gt;&lt;img alt="Custom_Parameter_Screen" border="0" class="asset  asset-image at-xid-6a00d835130c5153ef0167608f94fe970b image-full" src="http://blog.watchfire.com/.a/6a00d835130c5153ef0167608f94fe970b-800wi" title="Custom_Parameter_Screen"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;&#xD;
&lt;p&gt; Let’s see a step by step process of adding a definition that will properly parse and test our “users” parameter in the example above.&lt;/p&gt;&#xD;
&lt;ol&gt;&#xD;
&lt;li&gt;We’ll start by giving this custom parameter definition the Reference Name &lt;strong&gt;RESTful_Path_Parameter&lt;/strong&gt;&lt;/li&gt;&#xD;
&lt;li&gt;In the Pattern field, we’ll enter the regular expression &lt;span style="font-family: 'courier new', courier;"&gt;&lt;strong&gt;/data/&lt;span style="color: #0000ff;"&gt;([\d\w\s%]+)&lt;/span&gt;/&lt;span style="color: #ff0000;"&gt;([\d\w\s%]+)&lt;/span&gt;/ &lt;/strong&gt;&lt;/span&gt;- This pattern includes two match groups, i.e. /data/&lt;span style="color: #0000ff;"&gt;&lt;strong&gt;group1&lt;/strong&gt;&lt;/span&gt;/&lt;span style="color: #ff0000;"&gt;&lt;strong&gt;group2&lt;/strong&gt;&lt;/span&gt;/, group1 denotes the parameter’s name, and group2 the parameter’s value&lt;/li&gt;&#xD;
&lt;li&gt;Since the name of the parameter is the first match group, we will define the &lt;strong&gt;Name group index&lt;/strong&gt; as “1”, and since the value of the parameter is the second match group, we will define the &lt;strong&gt;Value group index&lt;/strong&gt; as “2”. This tells AppScan to extract the name of the parameter from group1, and the value of the parameter from group2. If you are dealing with a Path that only includes a parameter value (i.e. nameless parameters), you can set the Name group index to an empty value, and only mark a single value group&lt;/li&gt;&#xD;
&lt;li&gt;Our RESTful service uses Path based parameters, so we’ll set the &lt;strong&gt;Location&lt;/strong&gt; to “Path”. In general, you can set it to either “Body”, “Path”, or “Query”.&lt;/li&gt;&#xD;
&lt;li&gt;In our scenario, we’ll leave the &lt;strong&gt;Condition&lt;/strong&gt; &lt;strong&gt;Pattern&lt;/strong&gt; empty. This pattern helps us to limit the behavior of the custom parameter definition, by setting another pattern match on the Location. For example, we could’ve defined the &lt;strong&gt;Condition&lt;/strong&gt; pattern to be: &lt;span style="font-family: 'courier new', courier;"&gt;&lt;strong&gt;^/data/&lt;/strong&gt;&lt;/span&gt;, and then our pattern parameter definition would only be relevant for Paths that actually begin with /data/.&lt;/li&gt;&#xD;
&lt;li&gt;In addition, in our scenario, we will leave the &lt;strong&gt;Response Pattern&lt;/strong&gt; empty. Just as an FYI - this pattern helps us to teach AppScan how to track the values of our custom parameter in scenarios where the application treats it as a session ID. In such cases, the application might not only embed new values in Paths (e.g. in web links), but also in other places in subsequent responses, such as XML elements, for example: &lt;span style="font-family: 'courier new', courier;"&gt;&amp;lt;newSessionID&amp;gt;12345678&amp;lt;/newSessionID&amp;gt;&lt;/span&gt; - In this case, we would have defined the following Response Pattern:&lt;strong&gt; &lt;br&gt; &lt;/strong&gt;&lt;strong&gt;&lt;span style="font-family: 'courier new', courier;"&gt;&amp;lt;newSessionID&amp;gt;([0-9]+)&amp;lt;/newSessionID&amp;gt;&lt;/span&gt; - &lt;/strong&gt;this tells AppScan that even though in the HTTP request, the parameter is called &lt;strong&gt;users&lt;/strong&gt;, it should extract new values from an XML element in subsequent responses, that is called &lt;strong&gt;newSessionID&lt;/strong&gt;. Tricky, complex but nevertheless useful!&lt;/li&gt;&#xD;
&lt;/ol&gt;&#xD;
&lt;p&gt;That’s it. Once we have our custom parameter definition in place, we can let AppScan crawl and test the application normally. After the Explore phase, you can have a peek in the &lt;strong&gt;Data&lt;/strong&gt; view, and look at the &lt;strong&gt;Script Parameters&lt;/strong&gt; table:&lt;/p&gt;&#xD;
&lt;p&gt;&lt;a href="http://blog.watchfire.com/.a/6a00d835130c5153ef0167608f94bd970b-popup" onclick="window.open( this.href, '_blank', 'width=640,height=480,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0' ); return false" style="display: inline;"&gt;&lt;img alt="Parameters_View" border="0" class="asset  asset-image at-xid-6a00d835130c5153ef0167608f94bd970b image-full" src="http://blog.watchfire.com/.a/6a00d835130c5153ef0167608f94bd970b-800wi" title="Parameters_View"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&#xD;
&lt;p&gt;As you can see above, each new RESTful parameter that is extracted and analyzed by AppScan is given a special name in the following format:&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-family: 'courier new', courier;"&gt;__patternParameter__[REFERENCE_NAME]_[NAME_GROUP]__INDEX&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;In our case, AppScan detected the &lt;strong&gt;users&lt;/strong&gt; parameter with 2 values – &lt;strong&gt;Bob&lt;/strong&gt; and &lt;strong&gt;Jane&lt;/strong&gt;, and the &lt;strong&gt;books&lt;/strong&gt; parameter with two values &lt;strong&gt;Bobs Biography&lt;/strong&gt; and &lt;strong&gt;Janes Biography.&lt;/strong&gt;&lt;/p&gt;&#xD;
&lt;p&gt;The INDEX part of the custom parameter is helpful if the regular expression that we created, caught on the same Path more than once. For example, consider the following Path:&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-family: 'courier new', courier;"&gt;&lt;strong&gt;/data/&lt;span style="color: #0000ff;"&gt;users/Bob&lt;/span&gt;&lt;/strong&gt;&lt;span style="color: #0000ff;"&gt;&lt;strong&gt;/&lt;span style="color: #111111;"&gt;data&lt;/span&gt;/&lt;span style="color: #ff0000;"&gt;phone/areacode&lt;/span&gt;/&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-family: 'courier new', courier;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;our pattern would actually match twice on this Path - the first match (index = 0) would set the parameter name to be &lt;span style="color: #0000ff;"&gt;&lt;strong&gt;users&lt;/strong&gt;&lt;/span&gt; and its value to be &lt;span style="color: #0000ff;"&gt;&lt;strong&gt;Bob&lt;/strong&gt;&lt;/span&gt;, and the second match (index = 1) would set the parameter name to be &lt;span style="color: #ff0000;"&gt;&lt;strong&gt;phone&lt;/strong&gt;&lt;/span&gt; and the its value to be &lt;span style="color: #ff0000;"&gt;&lt;strong&gt;areacode&lt;/strong&gt;&lt;/span&gt;.&lt;strong&gt; &lt;/strong&gt;In such case, the name of the custom parameter would appear as:&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="font-family: 'courier new', courier;"&gt;&lt;strong&gt;__patternParameter__RESTful_Path_Parameter__phone__1&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;h3&gt;Explore Optimization Module&lt;/h3&gt;&#xD;
&lt;p&gt;Mastering AppScan’s custom parameters definition could be a daunting task, but this feature is extremely powerful and will allow you to create complex definitions that could parse non-standard HTTP messages of any type and form. If you are in a hurry, lazy, or simply hate regular expressions, there’s an automated way to detect custom parameters by using AppScan’s &lt;strong&gt;Explore Optimization Module&lt;/strong&gt;, which is available through the &lt;strong&gt;Tools-&amp;gt;Extensions-&amp;gt;Explore Optimization Module&lt;/strong&gt; (Configure or Run):&lt;/p&gt;&#xD;
&lt;p&gt;&lt;a href="http://blog.watchfire.com/.a/6a00d835130c5153ef0162ff9adc28970d-popup" onclick="window.open( this.href, '_blank', 'width=640,height=480,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0' ); return false" style="display: inline;"&gt;&lt;img alt="Explore_Optimization_Module_Menu" border="0" class="asset  asset-image at-xid-6a00d835130c5153ef0162ff9adc28970d image-full" src="http://blog.watchfire.com/.a/6a00d835130c5153ef0162ff9adc28970d-800wi" title="Explore_Optimization_Module_Menu"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;&#xD;
&lt;p&gt;This extension runs a smart algorithm that will statistically detect URL rewriting rules, such as those that are heavily used by RESTful web applications to generate its directory structure-like URLs. For example, given enough URLs of the format &lt;span style="font-family: 'courier new', courier;"&gt;&lt;strong&gt;/data/users/&lt;span style="color: #0000ff;"&gt;VALUE&lt;/span&gt;/... &lt;/strong&gt;&lt;/span&gt;this module will automatically generate a custom parameter definition for you.&lt;/p&gt;&#xD;
&lt;p&gt;How much is “enough URLs”? This depends on the configuration of the module and specifically on its &lt;strong&gt;Switch Complexity Limit&lt;/strong&gt;, which by default is set to 50, meaning that you must have 50 different values for the /users parameter.&lt;/p&gt;&#xD;
&lt;p&gt;If you want this module to automatically kick in during scans, you can enable it by going to: &lt;strong&gt;Tools-&amp;gt;Extensions-&amp;gt;Explore Optimization Module: Configure&lt;/strong&gt;, and checking the box next to &lt;strong&gt;Always run automatically during scans&lt;/strong&gt;.&lt;strong&gt; &lt;/strong&gt;The module will start working once AppScan has crawled 1,000 URLs. You can increase or decrease this default threshold through the &lt;strong&gt;Minimum links to start module&lt;/strong&gt; configuration. If you suspect that your application is using RESTful services, and the module was disabled when you first scanned it, you can always simply run it by going to:  &lt;strong&gt;Tools-&amp;gt;Extensions-&amp;gt;Explore Optimization Module: Run&lt;/strong&gt;&lt;/p&gt;&#xD;
&lt;p&gt;After the module ran, AppScan’s scan log will include special messages related to this module, for example:&lt;/p&gt;&#xD;
&lt;p&gt;&lt;a href="http://blog.watchfire.com/.a/6a00d835130c5153ef0162ff9aeea1970d-popup" onclick="window.open( this.href, '_blank', 'width=640,height=480,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0' ); return false" style="display: inline;"&gt;&lt;img alt="Scan_Log" border="0" class="asset  asset-image at-xid-6a00d835130c5153ef0162ff9aeea1970d image-full" src="http://blog.watchfire.com/.a/6a00d835130c5153ef0162ff9aeea1970d-800wi" title="Scan_Log"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;&#xD;
&lt;p&gt;There you go. All I had to do was to let AppScan crawl the application for a few minutes, then Run the module, and it automatically created a custom parameter definition with the regular expression &lt;span style="font-family: 'courier new', courier;"&gt;&lt;strong&gt;users/([^/]+)&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;In general, the more URLs you have, the better this module will behave.&lt;/p&gt;&#xD;
&lt;p&gt;It is also iterative - if you continue scanning the application after it created the first round of definitions, and once it hit the threshold again, or once you clicked on Run, it will refine these rules and create new ones where needed. Simple and elegant, albeit less accurate and powerful than the manual option mentioned earlier. That's it.&lt;/p&gt;&#xD;
&lt;p&gt;This post was a bit long, you probably need a REST now.&lt;/p&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/WatchfireApplicationSecurityInsider?a=LjZUXx_cFGI:SiM83O9bpqA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WatchfireApplicationSecurityInsider?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WatchfireApplicationSecurityInsider?a=LjZUXx_cFGI:SiM83O9bpqA:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WatchfireApplicationSecurityInsider?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WatchfireApplicationSecurityInsider?a=LjZUXx_cFGI:SiM83O9bpqA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WatchfireApplicationSecurityInsider?i=LjZUXx_cFGI:SiM83O9bpqA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WatchfireApplicationSecurityInsider/~4/LjZUXx_cFGI" height="1" width="1"/&gt;</content>



    </entry>
 
</feed><!-- ph=1 -->

