<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>The Connected Information Security Group</title><link>http://blogs.msdn.com/b/cisg/</link><description /><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>This Blog URL Has Changed – Please Update Your Readers</title><link>http://blogs.msdn.com/b/cisg/archive/2009/04/16/this-blog-url-has-changed-please-update-your-readers.aspx</link><pubDate>Thu, 16 Apr 2009 17:52:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9552998</guid><dc:creator>cisg</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/cisg/rsscomments.aspx?WeblogPostID=9552998</wfw:commentRss><comments>http://blogs.msdn.com/b/cisg/archive/2009/04/16/this-blog-url-has-changed-please-update-your-readers.aspx#comments</comments><description>&lt;p&gt;Things have been quite on the blog for while. There is a LOT of code being cranked out at the moment as we work towards some deadlines in the summer on various projects. &lt;/p&gt;  &lt;p&gt;Our team name has also changed from the Connected Information Security Group (CISG) to the Microsoft IT Information Security Tools Team. This reflects an increased scope of tools that we are building and areas that we are focusing on so we have updated the blog URL. Well leave all the content as is on this blog but all new content will be posted at the new URL. &lt;/p&gt;  &lt;p&gt;As well as news about significant work on CAT.NET and a Beta for TAM 3.0 we plan to start sharing details of the development framework CISF that we are building and a Risk Tracker application; both of which we plan to release open source under an MS-PL license this summer. CISF is a set of reusable components and code from which you can assemble your own security management applications (including gluing various security tools and technology together). It’s built in C# and on the MSFT technology stack (.NET 3.5 (WWF, WCF. ASP.NET etc)), SQL Server 2008 and Windows Server. You can think of Risk Tracker as a “Security Starter Kit” using the CISF; it’s essentially a Risk Tracking application that we have built internally for the corporate information security team which we will generalize and share with the community. You will be able to run it as is or extend it with .NET and the CISF. We plan to extend both tools on a regular basis (quarterly updates) as we improve the tools and technology for internal use. &lt;/p&gt;  &lt;p&gt;More news in a few weeks!&lt;/p&gt;  &lt;p&gt;You can subscribe to the new blog at &lt;a href="http://blogs.msdn.com/securitytools"&gt;http://blogs.msdn.com/securitytools&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Cheers!&lt;/p&gt;  &lt;p&gt;Mark&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9552998" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/cisg/archive/tags/Frameworks+and+Platforms/">Frameworks and Platforms</category><category domain="http://blogs.msdn.com/b/cisg/archive/tags/Anti_2D00_XSS/">Anti-XSS</category><category domain="http://blogs.msdn.com/b/cisg/archive/tags/CISG/">CISG</category><category domain="http://blogs.msdn.com/b/cisg/archive/tags/Product+Management/">Product Management</category><category domain="http://blogs.msdn.com/b/cisg/archive/tags/BPM/">BPM</category><category domain="http://blogs.msdn.com/b/cisg/archive/tags/CAT-NET/">CAT.NET</category></item><item><title>CAT.NET New Build – 1.1.1.8</title><link>http://blogs.msdn.com/b/cisg/archive/2009/03/20/cat-net-new-build-1-1-1-8.aspx</link><pubDate>Fri, 20 Mar 2009 22:02:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9493214</guid><dc:creator>cisg</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/cisg/rsscomments.aspx?WeblogPostID=9493214</wfw:commentRss><comments>http://blogs.msdn.com/b/cisg/archive/2009/03/20/cat-net-new-build-1-1-1-8.aspx#comments</comments><description>&lt;p&gt;Mainly small bug fixes and a new feature to export the findings into an Excel spreadsheet. &lt;/p&gt;  &lt;p&gt;Download link is -&lt;/p&gt;  &lt;p&gt;&lt;a title="http://www.microsoft.com/downloads/details.aspx?FamilyId=0178e2ef-9da8-445e-9348-c93f24cc9f9d&amp;amp;displaylang=en" href="http://www.microsoft.com/downloads/details.aspx?FamilyId=0178e2ef-9da8-445e-9348-c93f24cc9f9d&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyId=0178e2ef-9da8-445e-9348-c93f24cc9f9d&amp;amp;displaylang=en&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;We recommend all users to upgrade to this version. &lt;/p&gt;  &lt;p&gt;We have some work now starting on new features including general performance improvements, UI improvements and rules maintenance. We expect these to be complete by summer after which time we then expect to undertake some core engine updates to significantly improve the performance, scalability and vulnerability coverage. &lt;/p&gt;  &lt;p&gt;Note: The MSDN download page says 1.0 but it is 1.1.1.8. well fix that ;-)&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9493214" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/cisg/archive/tags/Secure+Coding/">Secure Coding</category><category domain="http://blogs.msdn.com/b/cisg/archive/tags/CAT-NET/">CAT.NET</category></item><item><title>Getting Help for CAT.NET and Anti-XSS</title><link>http://blogs.msdn.com/b/cisg/archive/2009/02/23/getting-help-for-cat-net-and-anti-xss.aspx</link><pubDate>Mon, 23 Feb 2009 17:42:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9441385</guid><dc:creator>cisg</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/cisg/rsscomments.aspx?WeblogPostID=9441385</wfw:commentRss><comments>http://blogs.msdn.com/b/cisg/archive/2009/02/23/getting-help-for-cat-net-and-anti-xss.aspx#comments</comments><description>&lt;p&gt;We now have a discussion forum for users of CAT.NET. There is no official support for these tools but you can ask questions and we will try to help wherever we can!&lt;/p&gt;  &lt;p&gt;CAT.NET - &lt;/p&gt;  &lt;p&gt;&lt;a href="http://social.msdn.microsoft.com/Forums/en-US/catnet/threads/"&gt;http://social.msdn.microsoft.com/Forums/en-US/catnet/threads/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Anti-XSS - &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.codeplex.com/AntiXSS/Thread/List.aspx"&gt;http://www.codeplex.com/AntiXSS/Thread/List.aspx&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9441385" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/cisg/archive/tags/Anti_2D00_XSS/">Anti-XSS</category><category domain="http://blogs.msdn.com/b/cisg/archive/tags/CISG/">CISG</category><category domain="http://blogs.msdn.com/b/cisg/archive/tags/Secure+Coding/">Secure Coding</category><category domain="http://blogs.msdn.com/b/cisg/archive/tags/CAT-NET/">CAT.NET</category></item><item><title>MSDN Webcast: Software Security with Static Code Analysis Using CAT.NET (Level 200)</title><link>http://blogs.msdn.com/b/cisg/archive/2009/02/16/msdn-webcast-software-security-with-static-code-analysis-using-cat-net-level-200.aspx</link><pubDate>Tue, 17 Feb 2009 02:32:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9426708</guid><dc:creator>cisg</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/cisg/rsscomments.aspx?WeblogPostID=9426708</wfw:commentRss><comments>http://blogs.msdn.com/b/cisg/archive/2009/02/16/msdn-webcast-software-security-with-static-code-analysis-using-cat-net-level-200.aspx#comments</comments><description>&lt;p&gt;&lt;b&gt;Event Overview&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;In this webcast, we provide an overview of what static code analysis is and typical coding errors that static analysis can and cannot detect. We also look at the recently released CAT.NET tool and how it helps with the detection of security flaws.    &lt;br /&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Presenter: &lt;/b&gt;Andreas Fuchsberger, Senior Software Design Engineer, Microsoft Corporation&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msevents.microsoft.com/CUI/Register.aspx?culture=en-US&amp;amp;EventID=1032402660&amp;amp;CountryCode=US"&gt;Register Here&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9426708" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/cisg/archive/tags/CISG/">CISG</category><category domain="http://blogs.msdn.com/b/cisg/archive/tags/Secure+Coding/">Secure Coding</category><category domain="http://blogs.msdn.com/b/cisg/archive/tags/CAT-NET/">CAT.NET</category></item><item><title>AntiXSS Library V3.0 - Test Harness</title><link>http://blogs.msdn.com/b/cisg/archive/2009/01/19/antixss-library-v3-0-test-harness.aspx</link><pubDate>Mon, 19 Jan 2009 13:55:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9339842</guid><dc:creator>cisg</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/cisg/rsscomments.aspx?WeblogPostID=9339842</wfw:commentRss><comments>http://blogs.msdn.com/b/cisg/archive/2009/01/19/antixss-library-v3-0-test-harness.aspx#comments</comments><description>&lt;p&gt;Hi, Anil Chintala here&amp;#8230;&lt;/p&gt;  &lt;p&gt;In this post I wanted to talk about the new Test Harness application which was released as part of the AntiXSS V3.0 Beta and is available as a free &lt;a target="_blank" href="http://www.microsoft.com/downloads/details.aspx?FamilyId=051ee83c-5ccf-48ed-8463-02f56a6bfc09&amp;amp;displaylang=en"&gt;download on MSDN&lt;/a&gt; with source code available for &lt;a target="_blank" href="http://www.codeplex.com/AntiXSS/"&gt;download on CodePlex&lt;/a&gt;. Test Harness application is created to help the users to quickly get started and validate the successful blocking of XSS issues by the Library and also to measure the enhanced performance claims of the AntiXSS V 3.0 against Microsoft .NET encoding library.&lt;/p&gt;  &lt;p&gt;AntiXSS Test Harness is a windows console application that automates the following two categories of tests - XSS validation and performance tests. When executed, AntiXSS Test Harness displays this console menu:&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;a href="http://blogs.msdn.com/blogfiles/cisg/WindowsLiveWriter/AntiXSSV3.0TestHarness_1404C/clip_image002_2.jpg"&gt;&lt;img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="clip_image002" src="http://blogs.msdn.com/blogfiles/cisg/WindowsLiveWriter/AntiXSSV3.0TestHarness_1404C/clip_image002_thumb.jpg" width="327" height="167" /&gt;&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Performance Test Bench&lt;/b&gt; uses HtmlEncode() method as a benchmark for measuring performance of the AntiXSS library - AntiXss.HtmlEncoding(&amp;#8230;) method against the .NET - HttpUtility.HtmlEncode(&amp;#8230;) encoding method. Input strings with a combination of safe and un-safe characters are used as payload to run the automated performance tests. &lt;/p&gt;  &lt;p&gt;Choosing Option#1, Performance Test Bench executes performance tests that analyze such metrics as: &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;     &lt;p&gt;Input string lengths&lt;/p&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;p&gt;Encoded output strings&lt;/p&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;p&gt;and the total time taken for its execution.&amp;#160; &lt;/p&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;During its run, Performance Test Bench compares the execution times of .NET's HttpUtility.HtmlEncode and AntiXss.HtmlEncode and stores in an output file containing results as displayed in this illustration: &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/cisg/WindowsLiveWriter/AntiXSSV3.0TestHarness_1404C/clip_image004_2.jpg"&gt;&lt;img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="clip_image004" src="http://blogs.msdn.com/blogfiles/cisg/WindowsLiveWriter/AntiXSSV3.0TestHarness_1404C/clip_image004_thumb.jpg" width="322" height="228" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;XSS Validation Test Bench&lt;/b&gt; demonstrates the successful blocking of cross-site scripts. These tests use a list of XSS exploits as payload for running the automated tests. XSS exploit list are read from a text file, each payload is run through HTMLEncode() method of the library and the encoded output is stored in an output file.&lt;/p&gt;  &lt;p&gt;When Option 2 is selected from the above console screen, Test Harness application executes the XSS validation tests and produces the following output file:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/cisg/WindowsLiveWriter/AntiXSSV3.0TestHarness_1404C/clip_image006_2.jpg"&gt;&lt;img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="clip_image006" src="http://blogs.msdn.com/blogfiles/cisg/WindowsLiveWriter/AntiXSSV3.0TestHarness_1404C/clip_image006_thumb.jpg" width="324" height="228" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Test Harness Application provides a framework for automating the XSS validation and performance evaluation. Primary objective is to help developers and testers to quickly get started and test AntiXSS library for XSS validation and performance. With the availability of source code on CodePlex it also allows advanced users to extend the automated testing capabilities as per your specific requirements.&lt;/p&gt;  &lt;p&gt;Thanks and more later&amp;#8230;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9339842" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/cisg/archive/tags/Anti_2D00_XSS/">Anti-XSS</category><category domain="http://blogs.msdn.com/b/cisg/archive/tags/CISG/">CISG</category></item><item><title>Current Memory Limitations of CAT.NET</title><link>http://blogs.msdn.com/b/cisg/archive/2009/01/12/current-memory-limitations-of-cat-net.aspx</link><pubDate>Mon, 12 Jan 2009 15:19:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9307697</guid><dc:creator>cisg</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/cisg/rsscomments.aspx?WeblogPostID=9307697</wfw:commentRss><comments>http://blogs.msdn.com/b/cisg/archive/2009/01/12/current-memory-limitations-of-cat-net.aspx#comments</comments><description>&lt;p&gt;Hi, Andreas Fuchsberger here.....&lt;/p&gt;  &lt;p&gt;It is important to understand what happens CAT.NET builds its Call Flow Super Graphs. We use a CCI object called CciControlGraph to build a Control Flow Graph for each method and each method call we find in the Common Intermediate Language (CIL) of the modules being analysed. These individual control flow graphs are collected together in a .NET List object.&lt;/p&gt;  &lt;p&gt;Unfortunately this is where we start to encounter a shortcoming in the implementation. Even with virtual memory there are limits to how much memory a single .NET application can allocate. As reported &lt;a href="http://blogs.msdn.com/tom/archive/2008/04/10/chat-question-memory-limits-for-32-bit-and-64-bit-processes.aspx"&gt;in recent blog post&lt;/a&gt; a 32-bit process, such as the CAT.NET Visual Studio plug-in version can only allocate about 1200 MB, even on a 4GB RAM (32-bit) system. Moreover another shortcoming of the current implementation is that when CAT.NET runs out of memory is it exits with an unhandled OutOfMemory (OOM) exception, unfortunately this does not get reported by the Visual Studio plug-in and the plug-in just seems to hang.&lt;/p&gt;  &lt;p&gt;There is a solution, on the same 4 GB RAM system you can more than double the amount of memory available to CAT.NET by using a 64-bit version of Vista or Windows Server and the 64-bit command line version of CAT.NET. This is why we supply the 64-bit command line version of the CAT.NET binaries: (&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=e0052bba-2d50-4214-b65b-37e5ef44f146"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=e0052bba-2d50-4214-b65b-37e5ef44f146&lt;/a&gt;). &lt;/p&gt;  &lt;p&gt;For those without the option of running on a 64-bit system, one manual method for analysing larger applications that the 32-bit version of CAT.NET fails to do is to restrict the number of modules that are passed to CAT.NET. For a developer analysing their own code it is relatively easy to make sensible choices which modules should be analysed together. Typically they would choose all the their own as code that receives user input and any dependant modules, e.g. third party libraries, that process that input to produce an output, leaving all other business logic modules aside. However it must be pointed out that this method lead to some vulnerabilities being missed.&lt;/p&gt;  &lt;p&gt;We are working on scalable long term solutions to these sorts of problems which require some relatively heavy lifting on our part. For today hopefully the above advice will at least help understand why the issue happens. &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9307697" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/cisg/archive/tags/CISG/">CISG</category><category domain="http://blogs.msdn.com/b/cisg/archive/tags/Secure+Coding/">Secure Coding</category><category domain="http://blogs.msdn.com/b/cisg/archive/tags/CAT-NET/">CAT.NET</category></item><item><title>Free MSDN Webcast: Managing Cross-Site Scripting Using CAT.NET and AntiXSS (Level 200)</title><link>http://blogs.msdn.com/b/cisg/archive/2009/01/04/free-msdn-webcast-managing-cross-site-scripting-using-cat-net-and-antixss-level-200.aspx</link><pubDate>Sun, 04 Jan 2009 12:36:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9271114</guid><dc:creator>cisg</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/cisg/rsscomments.aspx?WeblogPostID=9271114</wfw:commentRss><comments>http://blogs.msdn.com/b/cisg/archive/2009/01/04/free-msdn-webcast-managing-cross-site-scripting-using-cat-net-and-antixss-level-200.aspx#comments</comments><description>&lt;p&gt;&lt;strong&gt;Language(s):&lt;/strong&gt;    &lt;br /&gt;English.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Product(s):&lt;/strong&gt;    &lt;br /&gt;Security.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Audience(s): &lt;/strong&gt;    &lt;br /&gt;Developer.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Duration:&lt;/b&gt;    &lt;br /&gt;60 Minutes&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Start Date:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Friday, January 09, 2009 12:00 PM Pacific Time (US &amp;amp; Canada)&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032398771&amp;amp;EventCategory=4&amp;amp;culture=en-US&amp;amp;CountryCode=US"&gt;Register Here&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9271114" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/cisg/archive/tags/Anti_2D00_XSS/">Anti-XSS</category><category domain="http://blogs.msdn.com/b/cisg/archive/tags/CISG/">CISG</category><category domain="http://blogs.msdn.com/b/cisg/archive/tags/Secure+Coding/">Secure Coding</category><category domain="http://blogs.msdn.com/b/cisg/archive/tags/CAT-NET/">CAT.NET</category></item><item><title>Merlin: Better Specifications for CAT.NET</title><link>http://blogs.msdn.com/b/cisg/archive/2009/01/02/merlin-better-specifications-for-cat-net.aspx</link><pubDate>Fri, 02 Jan 2009 22:05:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9269576</guid><dc:creator>cisg</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/cisg/rsscomments.aspx?WeblogPostID=9269576</wfw:commentRss><comments>http://blogs.msdn.com/b/cisg/archive/2009/01/02/merlin-better-specifications-for-cat-net.aspx#comments</comments><description>&lt;p&gt;Guest post by &lt;a href="http://research.microsoft.com/en-us/um/people/livshits/"&gt;Ben Livshits&lt;/a&gt; of Microsoft Research here....&lt;/p&gt;  &lt;p&gt;In the last several years we have seen a proliferation of static (and sometimes runtime) analysis tools for finding web application vulnerabilities. Companies such as Fortify, Ouncelabs, Klockwork, and others have been selling tools for finding security flaws for a while now. Most focus of the &lt;a href="http://www.owasp.org/index.php/Top_10_2007"&gt;OWASP top 10&lt;/a&gt;, a list being dominated by XSS, SQL injection, CSRF, etc. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cisg/archive/2008/12/18/cat-net-ctp-links-are-live-again.aspx"&gt;CAT.NET&lt;/a&gt; is a state-of-the-art static analysis tool for .NET that we have built at Microsoft and released for free to all of our customers. &lt;/p&gt;  &lt;p&gt;The &lt;em&gt;effectiveness&lt;/em&gt; of these tools is generally seen as a function of false positives and false negatives. Ideally, of course, you want to find all real vulnerabilities &lt;em&gt;and &lt;/em&gt;eliminate&amp;#160; all false alarms. In practice, most tools have to cut corners to avoid erring too much in either direction. While much has been said about the approaches to static analysis and improving result quality, an Achilles heel of any analysis tool is the quality of the &lt;em&gt;specification&lt;/em&gt; that comes with. Simply, the analysis engine needs to be told what to look for. If the tool doesn&amp;#8217;t know what methods are used for sending queries to a database and are therefore crucial to SQL injection finding or if some taint sources are omitted for XSS, some potential vulnerabilities will go missing. The following is but a short list of taint sources in typical .NET APIs:&lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="2" width="400" align="center"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="200"&gt;         &lt;ul&gt;           &lt;ul&gt;             &lt;li&gt;Request.Params &lt;/li&gt;              &lt;li&gt;Request.QueryString &lt;/li&gt;              &lt;li&gt;Request.Form &lt;/li&gt;              &lt;li&gt;Request.Headers &lt;/li&gt;           &lt;/ul&gt;         &lt;/ul&gt;       &lt;/td&gt;        &lt;td valign="top" width="200"&gt;         &lt;ul&gt;           &lt;ul&gt;             &lt;li&gt;Request.ServerVariables &lt;/li&gt;              &lt;li&gt;Request.Cookies &lt;/li&gt;              &lt;li&gt;TextBox.Text &lt;/li&gt;              &lt;li&gt;HiddenField.Value &lt;/li&gt;           &lt;/ul&gt;         &lt;/ul&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;However, as a &lt;a href="http://blogs.msdn.com/cisg/archive/2008/09/10/real-world-xss-vulnerabilities-in-asp-net-code.aspx"&gt;recent blog&lt;/a&gt; post discusses, this list is woefully incomplete. Even in the case of taint-style vulnerabilities, coming up with a complete specification is really hard for several reasons. First, it often requires pouring over tons of potentially relevant APIs. There are about 30 methods in .NET base class libraries alone that CAT.NET considers to be taint sources. Second, in many cases, the specification is application- or library-specific. For a large-scale app, it&amp;#8217;s not uncommon to have a custom encoder or a sanitizer. Unless the tool knows about it, false positives will likely result.&lt;/p&gt;  &lt;p&gt;Enter Merlin, an add-on for CAT.NET that aims to produce a better, more complete and accurate specification for finding security bugs. Merlin uses the intuition embedded within the application itself to infer a better specification. &lt;/p&gt;  &lt;h3&gt;Code Example&lt;/h3&gt;  &lt;p&gt;Consider a simple example below. Suppose we are trying to classify functions &lt;strong&gt;ReadData1&lt;/strong&gt;, &lt;strong&gt;ReadData2&lt;/strong&gt;, &lt;strong&gt;WriteData&lt;/strong&gt;, and &lt;strong&gt;Cleanse&lt;/strong&gt; as either &lt;em&gt;sources&lt;/em&gt;, &lt;em&gt;sanitizers&lt;/em&gt;, or &lt;em&gt;sinks&lt;/em&gt;. Unless we know something else about these example, this is hard to do. &lt;/p&gt;  &lt;table border="0"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="614"&gt;         &lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;           &lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;             &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; ProcessRequest()&lt;/pre&gt;

            &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;

            &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;    &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; s1 = &lt;strong&gt;ReadData1&lt;/strong&gt;(&lt;span style="color: #006080"&gt;&amp;quot;name&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

            &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;    &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; s2 = &lt;strong&gt;ReadData2&lt;/strong&gt;(&lt;span style="color: #006080"&gt;&amp;quot;encoding&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

            &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

            &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;    &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; s3 = &lt;strong&gt;Cleanse&lt;/strong&gt;(s1);&lt;/pre&gt;

            &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

            &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;    WriteData(&lt;span style="color: #006080"&gt;&amp;quot;Parameter &amp;quot;&lt;/span&gt; + s1);&lt;/pre&gt;

            &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;    WriteData(&lt;span style="color: #006080"&gt;&amp;quot;Header &amp;quot;&lt;/span&gt; + s2);&lt;/pre&gt;

            &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt; }&lt;/pre&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/td&gt;

      &lt;td valign="top" width="318"&gt;&amp;#160;&lt;a href="http://blogs.msdn.com/blogfiles/cisg/WindowsLiveWriter/MerlinbetterspecficationsforCAT.NET_1474F/image_2.gif" rel="WLPP"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="image" border="0" alt="image" align="right" src="http://blogs.msdn.com/blogfiles/cisg/WindowsLiveWriter/MerlinbetterspecficationsforCAT.NET_1474F/image_thumb.gif" width="282" height="303" /&gt;&lt;/a&gt; &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;However, if you are told that &lt;strong&gt;ReadData1&lt;/strong&gt; and &lt;strong&gt;ReadData2&lt;/strong&gt; are &lt;em&gt;sources &lt;/em&gt;and &lt;strong&gt;Cleanse&lt;/strong&gt; is a &lt;em&gt;sanitizer, &lt;/em&gt;then &lt;strong&gt;WriteData&lt;/strong&gt; is likely to be is a sink. Why? Because why else would the developer sanitize tainted input on not one, but two paths. This is most obvious if you look at the propagation graph on the right.&lt;/p&gt;

&lt;p&gt;In other words, the program itself contains valuable clues that tell us what the developer &lt;em&gt;thought&lt;/em&gt; these functions were with respect to tainting or untaining values. Of course, the developer could still be wrong, there would be no vulnerabilities otherwise, so Merlin generally looks for preponderance of evidence before drawing any conclusions. In this case, Merlin will be able to classify &lt;strong&gt;WriteData&lt;/strong&gt; as a sink with a pretty high probability. The technique that Merlin uses called statistical inference is a generalization of the intuition above.&lt;/p&gt;

&lt;h3&gt;What does Merlin give us: some results&lt;/h3&gt;

&lt;p&gt;Before we talk about the gory technical details, which are also described in great detail in &lt;a href="http://research.microsoft.com/en-us/um/people/livshits/papers/tr/merlin_tr.pdf"&gt;our technical report&lt;/a&gt;, I&amp;#8217;ll give you a glimpse of what our approach can do by citing some experimental results. What is utterly surprising is that, without requiring &lt;em&gt;any initial specification at all&lt;/em&gt;, Merlin is able to derive the following specification shown on the right from the little program below.&lt;/p&gt;

&lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;
  &lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;
    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;protected&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; TextChanged(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; sender, EventArgs e) {&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; str = Request.QueryString[&lt;span style="color: #006080"&gt;&amp;quot;name&amp;quot;&lt;/span&gt;];&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; str2 = HttpUtility.HtmlEncode(str);&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;     Response.Write(str2);&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt; }&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;protected&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; ButtonClicked(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; sender, EventArgs e) {&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; str = Request.UrlReferrer.AbsolutePath;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; str2 = HttpUtility.UrlEncode(str);&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;     Response.Redirect(str2);&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Here is what Merlin infers for this example program:&lt;/p&gt;

&lt;div style="border-bottom: lightgray 1px solid; border-left: lightgray 1px solid; padding-bottom: 5px; margin: 10px; padding-left: 5px; padding-right: 5px; border-top: lightgray 1px solid; border-right: lightgray 1px solid; padding-top: 5px"&gt;&lt;strong&gt;Sources (1):&lt;/strong&gt; 

  &lt;br /&gt;string System.Web.HttpUtility+UrlDecoder.Getstring() 

  &lt;br /&gt;&lt;strong&gt;Sanitizers (8): 
    &lt;br /&gt;&lt;/strong&gt;string &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.httputility.htmlencode.aspx "&gt;System.Web.HttpUtility.HtmlEncode&lt;/a&gt;(string) 

  &lt;br /&gt;string System.Web.HttpUtility.UrlEncodeSpaces(string) 

  &lt;br /&gt;string &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.httpserverutility.urldecode.aspx "&gt;System.Web.HttpServerUtility.UrlDecode&lt;/a&gt;(string) 

  &lt;br /&gt;string &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.httputility.urlencode.aspx "&gt;System.Web.HttpUtility.UrlEncode&lt;/a&gt;(string, Encoding) 

  &lt;br /&gt;string &lt;a href="msdn.microsoft.com/en-us/library/system.web.httputility.urlencode.aspx "&gt;System.Web.HttpUtility.UrlEncode&lt;/a&gt;(string) 

  &lt;br /&gt;string System.Web.HttpServerUtility.UrlEncode(string) 

  &lt;br /&gt;string System.Web.HttpUtility.UrlDecodestringFromstringInternal... 

  &lt;br /&gt;string System.Web.HttpUtility.UrlDecode(string, Encoding) 

  &lt;br /&gt;&lt;strong&gt;Sinks (4):&lt;/strong&gt; 

  &lt;br /&gt;void System.Web.HttpResponse.WriteFile(string) 

  &lt;br /&gt;void System.Web.HttpRequest.set_QuerystringText(string) 

  &lt;br /&gt;void System.IO.TextWriter.Write(string) 

  &lt;br /&gt;void System.Web.HttpResponse.Redirect(string)&lt;/div&gt;

&lt;p&gt;This is actually a pretty good start! I highlighted a few of the methods so that you can look up their definition at MSDN. The sanitizers are in fact standard URL and HTML encoders provided by .NET. Note that even some of these are missing from the default .NET specification. You will recognize some other methods like HttpResponse.Redirect as sinks for the reflective XSS vulnerability. Similarly, HttpResponse.WriteFile exposes a command injection vulnerability.&lt;/p&gt;

&lt;p&gt;Of course, the better your initial specification, the more Merlin can help. The second part of this blog will talk about the technical aspects of Merlin inference and also show some more results.&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:3ebc6f03-0ae7-4a33-95f9-559fb87891d0" class="wlWriterSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/CAT.NET" rel="tag"&gt;CAT.NET&lt;/a&gt;,&lt;a href="http://technorati.com/tags/static%20analysis" rel="tag"&gt;static analysis&lt;/a&gt;&lt;/div&gt;

&lt;p&gt;More reading: &lt;a href="http://research.microsoft.com/en-us/um/people/livshits/papers/tr/merlin_tr.pdf"&gt;Merlin technical report&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9269576" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/cisg/archive/tags/CISG/">CISG</category><category domain="http://blogs.msdn.com/b/cisg/archive/tags/Secure+Coding/">Secure Coding</category><category domain="http://blogs.msdn.com/b/cisg/archive/tags/CAT-NET/">CAT.NET</category></item><item><title>Security Code Review Using CAT.NET - Part 2</title><link>http://blogs.msdn.com/b/cisg/archive/2008/12/22/security-code-review-using-cat-net-part-2.aspx</link><pubDate>Mon, 22 Dec 2008 12:24:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9246695</guid><dc:creator>cisg</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/cisg/rsscomments.aspx?WeblogPostID=9246695</wfw:commentRss><comments>http://blogs.msdn.com/b/cisg/archive/2008/12/22/security-code-review-using-cat-net-part-2.aspx#comments</comments><description>&lt;p&gt;Hi Andreas Fuchsberger here again......&lt;/p&gt;  &lt;p&gt;How does CAT.NET work?&lt;/p&gt;  &lt;p&gt;As I mentioned in &lt;a href="http://blogs.msdn.com/cisg/archive/2008/12/22/security-code-review-using-cat-net-part-1.aspx"&gt;Part 1 here&lt;/a&gt;, CAT.NET is an information-flow type static analysis tool using an implementation of tainted-variable analysis. &lt;/p&gt;  &lt;p&gt;Tainted-variable analysis is an integrity problem in which that tries to identify whether less-trusted data obtained from the user might influence other data that the system trusts. Clearly, to do this analysis, sources and sinks of possibly tainted data need to be identified. For managed code, this amounts to identifying methods that originate a tainted value and methods that use a possibly tainted value. For CAT.NET a number of XML of user editable configuration files is used to define sources and sinks. Then CAT.NET needs to find how information is stored in a variable and where it is used later in any other module of the application.&lt;/p&gt;  &lt;p&gt;CAT.NET uses the Common Compiler Infrastructure (CCI) which is used extensively within Microsoft for building compiler-like tools.CCI is an integrated set of components that encapsulate the logic that compilers and related development tools typically have in common. CCI has many features but firstly for CAT.NET it has the ability to read the Common Intermediate Language (CIL) used to store binary code in a .NET Framework assembly directly. &lt;/p&gt;  &lt;p&gt;Further to perform its analysis CAT.NET needs to build of a specific heap analysis called flow-insensitive &lt;i&gt;points-to&lt;/i&gt; analysis. This analysis computes a &amp;#8220;may point to&amp;#8221; relation over a loaded assembly or assemblies, we&amp;#8217;ll call this relation &lt;i&gt;pointsTo, &lt;/i&gt;where &lt;i&gt;pointsTo(o&lt;sub&gt;1&lt;/sub&gt;.f, o&lt;sub&gt;2&lt;/sub&gt;)&lt;/i&gt; means that the field &lt;i&gt;f&lt;/i&gt; of the object named &lt;i&gt;o&lt;sub&gt;1&lt;/sub&gt;&lt;/i&gt; might refer to the object named &lt;i&gt;o&lt;sub&gt;2&lt;/sub&gt;&lt;/i&gt; in some execution of the program. A may-point-to relation is also computed for local variables: &lt;i&gt;pointsTo(&amp;#965;, o)&lt;/i&gt; means that the local variable &lt;i&gt;&amp;#965;&lt;/i&gt; might refer to the object named &lt;i&gt;o&lt;/i&gt;. The relation &lt;i&gt;pointsTo(&amp;#965;.f, o)&lt;/i&gt; holds if there exists an &lt;i&gt;o&amp;#8217;&lt;/i&gt; such that &lt;i&gt;pointsTo(&amp;#965;, o&amp;#8217;)&lt;/i&gt; and &lt;i&gt;pointsTo(o&amp;#8217;.f, o)&lt;/i&gt;.&lt;/p&gt;  &lt;p&gt;CAT.NET uses a combination of Control Flow and Data Flow Graphs and to build the relation for every object in every module supplied to CAT.NET. &lt;/p&gt;  &lt;p&gt;Control Flow Graphs&lt;/p&gt;  &lt;p&gt;A control flow graph (CFG) is a representation of a program where contiguous regions of code without branches, known as basic blocks, are represented as nodes in a graph and edges between nodes indicate the possible flow of the program. A CFG shows the sequence of events as a program executes. &lt;/p&gt;  &lt;p&gt;Data Flow Graphs&lt;/p&gt;  &lt;p&gt;A data-flow graph (DFG) is a graph which represents operations and data dependencies and the order the operations are performed. As such any algorithm consists of a number of ordered operations. However simple DFGs are not able to represent loops or sub routine branching. Data Flow Graphs are therefore are often augmented with control-flow information and are then known as Control Data Flow Graphs (CDFG). A DFG consists of nodes and arcs, where the each node represented has an input or an output port and an arc represents a connection between and input and output port. &lt;/p&gt;  &lt;p&gt;Data Flow Super Graphs&lt;/p&gt;  &lt;p&gt;Defined by CAT.NET a data flow super graph is a special type of data flow graph that contains data flow information at both an intra-procedural and inter-procedural level.&lt;/p&gt;  &lt;p&gt;CCI provides functions for building the Data Flow and Control Flow Graphs on an intra-procedural level and CAT.NET uses these to build a Data Flow Super Graph. The Data Flow Super Graph that CAT.NET builds covers all objects across methods in all modules on an inter-procedural level.&lt;/p&gt;  &lt;p&gt;Once the Data Flow Super Graph is built, CAT.NET iterates for each of the XML that makes up the CAT.NET rules across Data Flow Super Graph to find all data flow paths between the sources and the sinks. It does this by traversing each path in the Data Flow Super Graph and colouring (i.e. assigning a constant to a traversed path) the graph according to the variables use. &lt;/p&gt;  &lt;p&gt;Before reporting a source is linked to a sink, CAT.NET checks how the variable is transformed and filters out valid transformations. Variables that remain tainted once a complete source to sink path has been traversed are reported as a possible vulnerability in the original code including file name and line numbers.&lt;/p&gt;  &lt;p&gt;In the next post I will explain the semantics of the XML rules and how to modify the supplied rule set.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9246695" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/cisg/archive/tags/CISG/">CISG</category><category domain="http://blogs.msdn.com/b/cisg/archive/tags/Secure+Coding/">Secure Coding</category><category domain="http://blogs.msdn.com/b/cisg/archive/tags/CAT-NET/">CAT.NET</category></item><item><title>Security Code Review Using CAT.NET - Part 1</title><link>http://blogs.msdn.com/b/cisg/archive/2008/12/22/security-code-review-using-cat-net-part-1.aspx</link><pubDate>Mon, 22 Dec 2008 12:20:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9246683</guid><dc:creator>cisg</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/cisg/rsscomments.aspx?WeblogPostID=9246683</wfw:commentRss><comments>http://blogs.msdn.com/b/cisg/archive/2008/12/22/security-code-review-using-cat-net-part-1.aspx#comments</comments><description>&lt;p&gt;Hi Andreas Fuchsberger here &amp;#8230;&lt;/p&gt;  &lt;p&gt;To coincide with the &lt;a href="http://blogs.msdn.com/cisg/archive/2008/12/15/anti-xss-3-0-beta-and-cat-net-community-technology-preview-now-live.aspx"&gt;CTP release of CAT.NET and Anti-XSS&lt;/a&gt;, within the &lt;a href="http://blogs.msdn.com/cisg/archive/2008/08/25/test.aspx"&gt;CSIG&lt;/a&gt; we have been taking a long hard look at static analysis tools for developers and Information Security professionals. Over the next series of blog posts I will explain the fundamentals of the techniques used for a code review in general and static code analysis in particular. &lt;/p&gt;  &lt;p&gt;Today we start with an introduction into the review process and as well having a look at the techniques for automating some of the code review burden; and don't worry we will build up to the details fast. &lt;/p&gt;  &lt;p&gt;In general we differentiate between a code review (source code) and an architectural review (software architecture). Although CAT.NET actually reads binary, actually Microsoft Intermediate Language code, it falls into the class of source code review tools.&lt;/p&gt;  &lt;p&gt;What is a code review?&lt;/p&gt;  &lt;p&gt;We say a code review is the process of systematically examining the source code written by one developer by someone other than the original developer, often called a reviewer. The reviewer could be a colleague or fellow developer or someone with similar developer background and skill set then we refer to this as a peer-review. Although most developers see the purpose of a code review to find coding errors the true value really lies really in the reviewer questioning assumptions by the original developer. It is often these unconsciously made assumptions that are the cause of business logic errors but also simple security errors (&amp;#8220;Oh the user would never try to enter more than 10 digit telephone number&amp;#8221;) .&lt;/p&gt;  &lt;p&gt;Formal roots of the code review go as far back as 1983 when it was first mentioned in a standard, IEEE 729, although it is probably true to say that code reviews took place before using corporate or in-house rules. &lt;/p&gt;  &lt;p&gt;According to the IEEE standard 729 &amp;#8220;Glossary of Software Engineering Terminology&amp;#8221;, which has since been republished as IEEE 610.12, a review is formally planned and structured analysis and evaluation process, during which the project results are presented to a team of consultant reviewers and commentated or approved by them.&lt;/p&gt;  &lt;p&gt;The reviewer could be a fellow software developer. For inexperienced developers a code review offers a good opportunity to learn, for an experienced developer it offers the opportunity for training themselves in fast and hands-on manner.&lt;/p&gt;  &lt;p&gt;And this unfortunately this is why the review process is so expensive both in cost of time and money. Reviewers are highly skilled people and performing a review takes time. So for some time now the Information Security research community has proposed automatic analysis techniques for identifying security vulnerabilities in code. Such techniques may employ dynamic analysis, static analysis, or both. &lt;/p&gt;  &lt;p&gt;Dynamic analysis entails executing the program and inferring properties from its observed behaviour. Although dynamic analysis may expose bugs, it cannot ensure complete coverage of the target program as not all program paths may be actually run.&lt;/p&gt;  &lt;p&gt;Instead, developers have adopted an approach based on sound analysis, which can provably identify all possible violations of specific security guidelines.&lt;/p&gt;  &lt;p&gt;In contrast Static analysis does not execute the code but analyses the code itself. Simple static analysis tools analyses the actual source code, however increasingly modern static analysis tools use also or only look at the binary output of the compiler. For intermediate code output, such as Microsoft&amp;#8217;s .NET Framework, this is in fact often preferable as the intermediate output still contains type information and &lt;/p&gt;  &lt;p&gt;Static analysis techniques&lt;/p&gt;  &lt;p&gt;There exist a number of static analysis techniques that can be used to automatically detect security errors in source code. These techniques cover three areas that have been associated with sources of security vulnerabilities:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Access control &lt;/li&gt;    &lt;li&gt;Information flow      &lt;ul&gt;       &lt;li&gt;Integrity violations &lt;/li&gt;        &lt;li&gt;Confidentiality violations &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;API conformance &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Access control: Mechanisms for access control restrict access to security-sensitive resources based on a user's identity and/or membership in predefined groups. Ensuring that an access control policy enforces the required level of security can be difficult, especially for systems with many components of different trust levels with access to a multitude of restricted resources. If an access control policy does not grant sufficient permissions to users, runtime authorization failures will occur. On the other hand, if an access control policy grants users unnecessary permissions, this will result in exposing the exposing the system to security attacks.&lt;/p&gt;  &lt;p&gt;Information flow: A secure information flow ensures that information propagates throughout the execution environment without violating two security integrity properties:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Integrity violations arise when untrusted information flows into a trusted execution environment without having been properly validated. A malicious user could compromise a system by exploiting an integrity violation. &lt;/li&gt; &lt;/ul&gt;  &lt;ul&gt;   &lt;li&gt;Confidentiality violations arise when confidential information flows from a restricted execution environment to a public one without having been properly declassified. For example, a confidentiality violation arises if trusted code exposes a cryptographic private key to untrusted code. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;API conformance: Applications often rely on libraries and third-party APIs to provide security-sensitive services. As an example, many applications rely heavily on cryptography libraries to protect confidentiality, prevent integrity violations, and distinguish between trusted and untrusted entities. Incorrect usage of cryptographic functions may lead to insecure storage of security-sensitive information and cause violations of integrity and confidentiality policies.&lt;/p&gt;  &lt;p&gt;Our CAT.NET tool is based on finding integrity violations by performing a tainted data flow analysis. Future posting will take a closer look at the algorithms we used for performing our analysis.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9246683" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/cisg/archive/tags/CISG/">CISG</category><category domain="http://blogs.msdn.com/b/cisg/archive/tags/Secure+Coding/">Secure Coding</category><category domain="http://blogs.msdn.com/b/cisg/archive/tags/CAT-NET/">CAT.NET</category></item></channel></rss>