<?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 : Frameworks and Platforms</title><link>http://blogs.msdn.com/cisg/archive/tags/Frameworks+and+Platforms/default.aspx</link><description>Tags: Frameworks and Platforms</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>This Blog URL Has Changed – Please Update Your Readers</title><link>http://blogs.msdn.com/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><comments>http://blogs.msdn.com/cisg/comments/9552998.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cisg/commentrss.aspx?PostID=9552998</wfw:commentRss><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/cisg/archive/tags/Frameworks+and+Platforms/default.aspx">Frameworks and Platforms</category><category domain="http://blogs.msdn.com/cisg/archive/tags/Anti-XSS/default.aspx">Anti-XSS</category><category domain="http://blogs.msdn.com/cisg/archive/tags/CISG/default.aspx">CISG</category><category domain="http://blogs.msdn.com/cisg/archive/tags/Product+Management/default.aspx">Product Management</category><category domain="http://blogs.msdn.com/cisg/archive/tags/BPM/default.aspx">BPM</category><category domain="http://blogs.msdn.com/cisg/archive/tags/CAT.NET/default.aspx">CAT.NET</category></item><item><title>ASP.NET Data Binding and AntiXss Encoding</title><link>http://blogs.msdn.com/cisg/archive/2008/10/01/asp-net-data-binding-and-antixss-encoding.aspx</link><pubDate>Wed, 01 Oct 2008 12:50:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8971360</guid><dc:creator>cisg</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/cisg/comments/8971360.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cisg/commentrss.aspx?PostID=8971360</wfw:commentRss><description>&lt;p&gt;Hi RV here again...&lt;/p&gt;  &lt;p&gt;Last time I looked at ASP.NET controls and few common scenarios where you need to use encoding. Couple of weeks back we looked at a sample data binding scenario. This time lets exclusively look at various ASP.NET data binding techniques and how to use AntiXss to encode the output.&lt;/p&gt;  &lt;h4&gt;Scenario #1: Eval()&lt;/h4&gt;  &lt;p&gt;Most common way of data binding in ASP.NET is by using Eval() method. Here is an ASP.NET label control bound to the &amp;quot;Comments&amp;quot; field of the data source.&lt;/p&gt;  &lt;p&gt;&lt;/p&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: #008000"&gt;&amp;lt;!--Usage #1--&amp;gt;&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;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;asp:Label&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;server&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;CommentsLabel&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Text&lt;/span&gt;&lt;span style="color: #0000ff"&gt;='&amp;lt;%# Eval(&amp;quot;Comments&amp;quot;) %&amp;gt;'&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&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: #008000"&gt;&amp;lt;!--Usage #2--&amp;gt;&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;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;asp:Label&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;server&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;CommentsLabel&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;                 &lt;span style="color: #ff0000"&gt;Text&lt;/span&gt;&lt;span style="color: #0000ff"&gt;='&amp;lt;%#DataBinder.Eval(Container.DataItem,&amp;quot;Comments&amp;quot;) %&amp;gt;'&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;By definition Eval() method uses reflection to bind the column at runtime this may affect performance of the application. Apart from the performance, as Eval() uses reflection it is generally inadvisable. Instead you should use Container.DataItem directly for binding and wrap it with AntiXss.HtmlEncode method to protect from XSS as shown below.&lt;/p&gt;

&lt;div&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;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;asp:Label&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;server&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;CommentsLabel&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;   2:&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Text&lt;/span&gt;&lt;span style="color: #0000ff"&gt;='&amp;lt;%#Microsoft.Security.Application.AntiXss.HtmlEncode&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; (((System.Data.DataRowView)Container.DataItem)[&amp;quot;Comments&amp;quot;].ToString()) %&amp;gt;'&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;By using Container.DataItem directly we improve performance and can use AntiXss with it. Note that you can still use AntiXss.HtmlEncode on just the Eval() method.&lt;/p&gt;

&lt;h4&gt;Scenario #2: Bind()&lt;/h4&gt;

&lt;p&gt;Bind() is another way of data binding in ASP.NET. Here is the same ASP.NET label control bound to the &amp;quot;Comments&amp;quot; field using Bind().&lt;/p&gt;

&lt;div&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;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;asp:Label&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;server&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;CommentsLabel&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Text&lt;/span&gt;&lt;span style="color: #0000ff"&gt;='&amp;lt;%#Bind(&amp;quot;Comments&amp;quot;) %&amp;gt;'&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Bind() is a very special way of data binding in ASP.NET. Unlike Eval() Bind() is not a method call so when ASP.NET compiler encounters Bind() statements, it will generate additional code for data binding. If you look at the code created in the ASP.NET Temporary Files Folder, it in fact has DataBinder.Eval statement. Unfortunately due to this there are limitations on what you can do with a Bind() statement. One limitation is that you cannot wrap Bind() statements with any other method calls. &lt;/p&gt;

&lt;div&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: #008000"&gt;//Code generated in the temporary file for the Bind() statement&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;   2:&lt;/span&gt; dataBindingExpressionBuilderTarget.Text = &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; System.Convert.ToString(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.Eval(&lt;span style="color: #006080"&gt;&amp;quot;Comments&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;     System.Globalization.CultureInfo.CurrentCulture);&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;For more information on this behavior check this &lt;a href="http://weblogs.asp.net/leftslipper/archive/2007/06/29/how-asp-net-databinding-deals-with-eval-and-bind-statements.aspx"&gt;blog post&lt;/a&gt;. In essence if you use Bind() statements, you should convert the code to use Eval() statements and wrap them with AntiXss library as shown in scenario #1 above.&lt;/p&gt;

&lt;h4&gt;Scenario #3: &amp;lt;%# %&amp;gt;&lt;/h4&gt;

&lt;p&gt;In some cases you might want to just bind some data to a control or a html element. This can be achieved by using &amp;lt;%# variable %&amp;gt; and Page.DataBind(). Here is some sample code.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;div&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: #008000"&gt;//variable declaration in the code behind file&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;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public string&lt;/span&gt; hyperLink=&lt;span style="color: #006080"&gt;&amp;quot;http://www.microsoft.com&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; Page.DataBind();&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;&amp;#160; &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;lt;!--In the ASP.NET page--&amp;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; &amp;lt;a href=&lt;span style="color: #006080"&gt;&amp;quot;&amp;lt;%# this.hyperLink %&amp;gt;&amp;quot;&lt;/span&gt;&amp;gt;Microsoft Corporation&amp;lt;/a&amp;gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Although this is somewhat a strange way to do this, it sure illustrates the point of data binding. In this case, by simply wrapping the this.hyperLink in AntiXss.HtmlEncode would fix the problem.&lt;/p&gt;

&lt;div&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; &amp;lt;%# Microsoft.Security.Application.AntiXss.HtmlEncode(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.strLocation) %&amp;gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;As we have seen in the above scenarios Bind() is the only case where you will not be able to protect from XSS using encoding, so the best option is to change the ASP.NET code to use Eval() statement.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8971360" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cisg/archive/tags/Frameworks+and+Platforms/default.aspx">Frameworks and Platforms</category><category domain="http://blogs.msdn.com/cisg/archive/tags/Anti-XSS/default.aspx">Anti-XSS</category><category domain="http://blogs.msdn.com/cisg/archive/tags/CISG/default.aspx">CISG</category></item><item><title>There's a LOT More to Building Security Software than Software Security</title><link>http://blogs.msdn.com/cisg/archive/2008/09/16/there-s-a-lot-more-to-building-security-software-than-software-security.aspx</link><pubDate>Tue, 16 Sep 2008 13:20:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8953718</guid><dc:creator>cisg</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/cisg/comments/8953718.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cisg/commentrss.aspx?PostID=8953718</wfw:commentRss><description>&lt;p&gt;Mark Curphey here.....&lt;/p&gt;  &lt;p&gt;I often get asked exactly what I do for a living at Microsoft. Many people associate my name with &lt;a href="http://www.owasp.org"&gt;OWASP&lt;/a&gt;, my &lt;a href="http://www.securitybuddha.com"&gt;personal blog&lt;/a&gt; and software security in general. When I say I am a PUM (Product Unit Manager)&amp;#160; and run a team that builds security tools most people understandably assume that we are only focused on software security or application security tools (preventing vulnerabilities or attacks). Part of this of course maybe because the current blogger's on this blog are the Anti-XSS development team! Given we build technology to support the corporate security program the remit is actually pretty wide and software security tools like Anti-XSS and the Threat Modelling tools make up a relatively small part of the portfolio.&amp;#160; In the coming weeks we will start&amp;#160; to discuss some of the security management tools we are going to be working but I wanted to highlight some of the Microsoft technology we are either using or considering using. Many people forget the sheer range of technology we have available to build feature rich security management applications. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://netfx3.com/content/WCFHome.aspx"&gt;.NET WCF&lt;/a&gt; - Windows Communication Foundation - Rich set of API's for building connected systems (think SOA).&amp;#160; It includes the ability to build services that talk WS-Security and can do XML digital signatures etc.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://http://netfx3.com/content/WFHome.aspx"&gt;.NET WWF&lt;/a&gt; - Windows Workflow Foundation - An awesome business process management suite of technologies including process design tools, process execution engines, business rules engines and business activity monitoring technology. If you think BPM is just workflow I encourage you to look hard at BPM technologies. We think BPM will revolutionize the way people manage information security in the future. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.microsoft.com/biztalk/en/us/default.aspx"&gt;BizTalk&lt;/a&gt; - Is an integration technology for building SOA's. It includes some BPM capability. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.microsoft.com/business/performancepoint/"&gt;Performance Point&lt;/a&gt; - Performance Point is a data analytics and Business Intelligence server. Basically you can pull in data, crunch it and produce reporting (including dashboards). It supports interesting methodologies such as Balanced Score Cards.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://netfx3.com/content/WindowsCardspaceHome.aspx"&gt;CardSpace&lt;/a&gt; - InfoCards that can be extended.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://connect.microsoft.com/site/sitehome.aspx?SiteID=642"&gt;Zermatt&lt;/a&gt; - new claims based ID management framework that can be used to build claims based authentication and authorization systems. Combine with CardSpace and SmartCards and ....... &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.codeplex.com"&gt;Codeplex&lt;/a&gt; - It's worth noting that there is a great deal of excellent code out on &lt;a href="http://www.codeplex.com"&gt;CodePlex&lt;/a&gt; such as the &lt;a href="http://www.codeplex.com/entlib"&gt;Enterprise Library&lt;/a&gt; and the &lt;a href="http://www.codeplex.com/esb"&gt;Enterprise Services Bus&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;Then consider things like ADFS, SharePoint, SQL 2008 (&lt;a href="http://msdn.microsoft.com/en-us/library/cc278098.aspx"&gt;full encryption of the DB on the fly&lt;/a&gt;) and its a rich set of technology on which to build applications. &lt;/p&gt;  &lt;p&gt;Next week I will walk you through a proof of concept we recently built to explore how some of this technology could be applied to the application security assessment space.&amp;#160; &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8953718" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cisg/archive/tags/Frameworks+and+Platforms/default.aspx">Frameworks and Platforms</category><category domain="http://blogs.msdn.com/cisg/archive/tags/CISG/default.aspx">CISG</category></item><item><title>Trip Report : Day Two of Gartner BPM Conference</title><link>http://blogs.msdn.com/cisg/archive/2008/09/12/trip-report-day-two-of-gartner-bpm-conference.aspx</link><pubDate>Fri, 12 Sep 2008 12:18:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8946090</guid><dc:creator>cisg</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/cisg/comments/8946090.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cisg/commentrss.aspx?PostID=8946090</wfw:commentRss><description>&lt;p&gt;Hi Marius here again with highlights from day 2 of the Gartner BPM conference.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Back of the Napkin&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;You may have heard of the book called &lt;a href="http://www.thebackofthenapkin.com/"&gt;The Back of the Napkin&lt;/a&gt;: Solving Problems and Selling Ideas with     &lt;br /&gt;Pictures. It&amp;#8217;s one of the latest books creating a buzz in business community. Dan Roam, the author     &lt;br /&gt;of the book presented on how the most daunting business problems can be described simply using     &lt;br /&gt;only stick figures in the space of a few square inches available on the back of a napkin. &lt;i&gt;Ultimately,      &lt;br /&gt;those who present the problem the best get the funding to proceed with their project&lt;/i&gt;. Dan argues that     &lt;br /&gt;there are three types of people. Those who immediately jump to the whiteboard and start sketching     &lt;br /&gt;in meetings (25% of us), those who are not artistic BUT will highlight what&amp;#8217;s interesting (50% of us), and     &lt;br /&gt;finally those who are not artistic and simply refuse to participate in the process (the remaining 25%).     &lt;br /&gt;Those who highlight don&amp;#8217;t come up with new ideas, but they are good at dissecting ideas presented to     &lt;br /&gt;them and highlight what really matters. Those who refuse to sketch do so because they understand     &lt;br /&gt;that what&amp;#8217;s being drawn is &lt;i&gt;far&lt;/i&gt; too simplistic to be reality. These people tend to have the most facts on     &lt;br /&gt;the problem. When they compare the drawings to their own information, they are turned away from     &lt;br /&gt;the conversation. The challenge is to find a way to involve these people, and the solution presented     &lt;br /&gt;was to (don&amp;#8217;t read if you&amp;#8217;re this last type ;-) ) to get them angry enough at the situation that they take     &lt;br /&gt;control, cross out the irrelevant information, and find a way to distill their facts into a way that fits onto     &lt;br /&gt;the drawing. Dan argues that visual communication transcends language and cultural barriers and can     &lt;br /&gt;be used to communicate complex ideas &amp;#8211; but these ideas need to be transformed into a combination     &lt;br /&gt;of the following: who/what, how much, where, why, how, and when. After talking a bit about     &lt;br /&gt;neurobiology, Dan explains that the brain has different visual pathways for each of these types of     &lt;br /&gt;information that are all processed in parallel. How can you present each type of information visually?     &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;Just follow this chart:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/cisg/WindowsLiveWriter/TripReportDayTwoofGartnerBPMConference_8C74/BackofNapkinByMarius_2.png"&gt;&lt;img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="BackofNapkinByMarius" src="http://blogs.msdn.com/blogfiles/cisg/WindowsLiveWriter/TripReportDayTwoofGartnerBPMConference_8C74/BackofNapkinByMarius_thumb.png" width="539" height="238" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The story given was that Dan had to present the problem statement around a financial process in    &lt;br /&gt;Microsoft. He drew the problem statement on paper using stick figures and didn&amp;#8217;t manipulate     &lt;br /&gt;the image through Illustrator or any such tool. The execs were impressed because he was able to     &lt;br /&gt;easily relate to them and they asked what software he used. Facetiously he replied &amp;#8220;Pen and Paper     &lt;br /&gt;1.0.&amp;#8221; The moral of the story however, is that the more human your presentation, the more human the     &lt;br /&gt;response will be.&lt;/p&gt;  &lt;p&gt;Next time you need to speak to your customer about pain points, try the following Wong-Baker pain    &lt;br /&gt;chart, used in emergency rooms:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/cisg/WindowsLiveWriter/TripReportDayTwoofGartnerBPMConference_8C74/clip_image014_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_image014" src="http://blogs.msdn.com/blogfiles/cisg/WindowsLiveWriter/TripReportDayTwoofGartnerBPMConference_8C74/clip_image014_thumb.jpg" width="576" height="412" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;BPM Modeling&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;The next session was about BPM modeling by one of the leaders of the BPMN standard. BPMN is a    &lt;br /&gt;powerful standard that can be used to model almost any business scenario. It is an easy to use way to     &lt;br /&gt;draw processes designed to be understood and used by business users. It&amp;#8217;s limitations include not     &lt;br /&gt;being able to model meetings (without resorting to an ad-hoc task) and serializing the model.     &lt;br /&gt;Serializing is necessary to be able to save the model in a way that is executable by a workflow engine.     &lt;br /&gt;Workarounds to the serialization issue are to export the model as XPDL or BEPL. Despite these issues     &lt;br /&gt;BPM vendors are retrofitting their tools to support BPMN 1.1 due to its power in modeling processes     &lt;br /&gt;and simplicity for business users. Want to give BPMN for a spin? Try the free tool:     &lt;br /&gt;&lt;a href="http://bizagi.com/eng/products/ba-modeler/desc-efective.html"&gt;http://bizagi.com/eng/products/ba-modeler/desc-efective.html&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Risk Management and Compliance&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;This was the one must see track session considering what our team does and I had to trade off several other    &lt;br /&gt;good presentations to attend this one. The key point delivered was that GRC is a short-term audit-driven need.     &lt;br /&gt;Nobody likes compliance (except for those whose jobs are compliance) but thanks to the likes of     &lt;br /&gt;Enron and MCI WorldCom we&amp;#8217;re in an ever increasing regulatory environment where imposed     &lt;br /&gt;regulations continue to grow. Businesses really wants performance and business risk management but     &lt;br /&gt;for now they are faced with immediate needs to track regulatory compliance. GRC tools out there     &lt;br /&gt;include some form of process, but they are still stovepipe applications. In the next 4-8 years, expect to     &lt;br /&gt;see BPM solutions move into the GRC space. Strengths of BPM in the GRC space are the fact that you     &lt;br /&gt;can set risk management workflows, perform policy mapping, model (and simulate) risks and controls,     &lt;br /&gt;automate controls, and analyze control effectiveness. In our experience, creating management     &lt;br /&gt;workflows and analysis of control effectiveness are some of the hot topics in the risk management     &lt;br /&gt;work. The weaknesses of BPM in the GRC space is related to domain knowledge and time to     &lt;br /&gt;implement. The primary drivers of GRC implementations today are the need for domain knowledge of     &lt;br /&gt;regulatory standards (something that BPM vendors do not have experience in) and a quick audit-     &lt;br /&gt;driven solution &amp;#8211; customers need a fast solution, not tools that enable them to create solutions. Since     &lt;br /&gt;&amp;#8220;pure&amp;#8221; GRC is a short-term need, the industry will begin to focus more on risk management, and     &lt;br /&gt;eventually business performance management. Since BPM is already in the realm of performance     &lt;br /&gt;management, the prediction is that BPM suites will start to include risk management and modeling     &lt;br /&gt;capability with compliance built-in to ensure that processes created through the tool are in&amp;#160;&amp;#160; &lt;br /&gt;compliance. &lt;/p&gt;  &lt;p&gt;&lt;b&gt;User Interface and Empowerment Disrupts Business Applications&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;From the start, it was a surprise to see how few people attended the keynote on user interfaces.    &lt;br /&gt;Rather, most attended the session on change management instead. Since my double was not available     &lt;br /&gt;at the time, I had to pick one or the other and went to the only session related to UX. The problem     &lt;br /&gt;statement presented is that the returns on automation are shrinking, mostly due to the fact that business     &lt;br /&gt;applications have already squeezed the people out of processes in most places. Many of the     &lt;br /&gt;remaining tasks end up being non-routine, highly cognitive, and interactive tasks&amp;#8212;and this trend is     &lt;br /&gt;growing. In second place are non-routine, highly cognitive, analytic tasks. Both of these types of tasks     &lt;br /&gt;are poor candidates for process automation. What should IT to do in these areas? Industry wide, IT is     &lt;br /&gt;already being seen as an inhibitor to business change. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/cisg/WindowsLiveWriter/TripReportDayTwoofGartnerBPMConference_8C74/clip_image018_2.gif"&gt;&lt;img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="clip_image018" src="http://blogs.msdn.com/blogfiles/cisg/WindowsLiveWriter/TripReportDayTwoofGartnerBPMConference_8C74/clip_image018_thumb.gif" width="473" height="356" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The answer is to model processes around business KPIs (not the opposite) and empower the business    &lt;br /&gt;user to have information at their fingertips and to &amp;#8220;design&amp;#8221; their own solution:&lt;/p&gt;  &lt;p&gt;&amp;#8226; &lt;b&gt;Focus on End-User Flexibility&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;- Enable end-user process flow design &lt;/p&gt;  &lt;p&gt;- Enable end-user-driven creation of apps through configurations, personalization,    &lt;br /&gt;mashups, compositions&lt;/p&gt;  &lt;p&gt;&amp;#8226; &lt;b&gt;Develop a Consumer like Experience&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;- Embedded user experience that includes Web 2.0 and user productivity like    &lt;br /&gt;experience&lt;/p&gt;  &lt;p&gt;- Immersive UI, pervasive mobility&lt;/p&gt;  &lt;p&gt;&amp;#8226; &lt;b&gt;Incorporate Context Into Processes&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;- Peer-based, ad hoc collaboration enabled&lt;/p&gt;  &lt;p&gt;- Community-generated content&lt;/p&gt;  &lt;p&gt;- Process and information design presented based on individual need&lt;/p&gt;  &lt;p&gt;&amp;#8226; &lt;b&gt;Include a Network-Centric Design&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;- Anyone can participate, from any organization, from any geography&lt;/p&gt;  &lt;p&gt;- Architected for high-volume, highly distributed, simultaneous connections&lt;/p&gt;  &lt;p&gt;- Information can originate from anyone, anywhere &amp;#8212; no boundaries&lt;/p&gt;  &lt;p&gt;&amp;#8226; &lt;b&gt;Provide Actionable, Intelligent Insights&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;- Predictive, proactive and context-aware analytics &lt;/p&gt;  &lt;p&gt;- External and internal cross-application content &lt;/p&gt;  &lt;p&gt;- Structured and unstructured data analysis/synthesis&lt;/p&gt;  &lt;p&gt;In the end this is really the &lt;b&gt;people&lt;/b&gt; component of people, process, and technology.&lt;/p&gt;  &lt;p&gt;Thanks for reading, more tomorrow. &lt;/p&gt;  &lt;p&gt;Marius&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8946090" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cisg/archive/tags/Frameworks+and+Platforms/default.aspx">Frameworks and Platforms</category><category domain="http://blogs.msdn.com/cisg/archive/tags/CISG/default.aspx">CISG</category><category domain="http://blogs.msdn.com/cisg/archive/tags/Product+Management/default.aspx">Product Management</category><category domain="http://blogs.msdn.com/cisg/archive/tags/Software+Requirements/default.aspx">Software Requirements</category><category domain="http://blogs.msdn.com/cisg/archive/tags/Program+Management/default.aspx">Program Management</category><category domain="http://blogs.msdn.com/cisg/archive/tags/BPM/default.aspx">BPM</category></item><item><title>Trip Report : Day One of Gartner BPM Conference</title><link>http://blogs.msdn.com/cisg/archive/2008/09/12/trip-report-day-one-of-gartner-bpm-conference.aspx</link><pubDate>Fri, 12 Sep 2008 12:11:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8946078</guid><dc:creator>cisg</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/cisg/comments/8946078.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cisg/commentrss.aspx?PostID=8946078</wfw:commentRss><description>&lt;p&gt;Marius Grigoriu here....&lt;/p&gt;  &lt;p&gt;I am a Program manager with CISG and in keeping with good program management its straight down to business. Today was the first official day of the Gartner BPM Conference at Washington DC and I am posting daily trip reports. In the Connected Information Security Group we believe that BPM or Business Process Management is key to the future of information security management. &lt;/p&gt;  &lt;p&gt;Three recurring themes emerged from the different presentations given today:&lt;/p&gt;  &lt;p&gt;1) Staffing&lt;/p&gt;  &lt;p&gt;2) Agility&lt;/p&gt;  &lt;p&gt;3) Continuous process improvement&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Themes:&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Staffing:&lt;/p&gt;  &lt;p&gt;Getting the right mix of people working on the BPM project is critical for success. Just throwing the smartest people in a room is a recipe for frustration without the proper roles, skills, and authority. At a minimum, BPM projects should include a business process owner, implementation lead, developers, SMEs, and an executive sponsor. The business process owner is the team member belonging to the business who has knowledge of the business process and has the authority to make changes to the process as necessary. The process owner defines the process being input into the BPMS and also drives adoption of the system in the business organization. The implementation lead is much like our program manager role on the CISG team. They work with the business process owner to model the process, collect other requirements, drive the creation of the solution. Somewhat misleading is the title as an implementation lead does not drive adoption within the business, but must work closely with the process owner to accomplish the task. &amp;#8220;Developers&amp;#8221; are not just devs, but includes the entire team necessary to support the development effort: architecture and design, development, testing, and appropriate management. Not mentioned were the IT operations staff members who should also be included and finally is executive sponsorship. SMEs are the team members who know the most about the as-is process including any undocumented and unofficial processes still necessary to their team&amp;#8217;s operations. The executive sponsor must be dedicated and willing to make hard decisions to push the project forward. By nature process decisions are decisions about people&amp;#8217;s jobs, which can become contentious at times. It was mentioned that an absent or hesitant executive sponsor is a show stopping danger sign --the executive sponsor must be 100% behind a BPM implementation project to succeed.&lt;/p&gt;  &lt;p&gt;Agility:&lt;/p&gt;  &lt;p&gt;Multiple speakers have mentioned the important of agility in implementing BPM. First, one of the general goals of BPM is to enable businesses to improve (read change) their processes through the collection of data and to decrease the cost of IT changes (vs. the monolithic LOB app). Thus one of the points of implementing BPM is to facilitate business change and agility. Next is that waiting for perfection in requirements and process documentation/modeling is counterproductive. Teams may contains unknown, unofficial sub-processes which are hard to discover even with SMEs on the team. At some point, perfecting requirements and designs require much more time for an incremental change in value. Playbacks such as rapid prototypes and iterative releases should be used to frequently obtain feedback along the journey. It is important to note that iterative releases are not the same as planned staged releases. The latter is executing on a pre-determined plan created with information from the early phases of the project. The former is about inspecting the work delivered, identifying gaps and areas of improvement, then addressing those issues. A BPM project is not a &amp;#8220;once and done&amp;#8221; implementation project like many other IT projects that are developed then put into sustained engineering mode. Even after iterations have completed, one or two dedicated resources will need to be available to handle continuous improvement process changes.&lt;/p&gt;  &lt;p&gt;Continuous Process Improvement:&lt;/p&gt;  &lt;p&gt;Related to agility is CPI, the #1 recurring topic so far and one of the big benefits of implementing BPM. CPI is made possible by the metrics and process visibility created by implementing and running BPM solutions. However this implies that resources need to stay on project after implementation to make the changes resulting from additional process analysis. As processes change, so will the system, and the BPM implementation needs to be build in a way that can accept change. Re-useable components and the use of BPM/rules engines to move away from business logic built-into application code have been mentioned as a way to achieve lower IT change costs.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;10 Habits of Successful Organizations Building BPM solutions:&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;1. Make BPM about productivity AND visibility:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Metrics, KPI, SLAs, should be part of the defining the process&lt;/li&gt;    &lt;li&gt;Try not to scope out metrics&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;2. Integration&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Don&amp;#8217;t underestimate the effort required to integrate systems and start early&lt;/li&gt;    &lt;li&gt;But don&amp;#8217;t get bogged down either &amp;#8211; don&amp;#8217;t let that delay your first project (which should be a low risk, high impact project)&lt;/li&gt;    &lt;li&gt;Be ready to trade off integrations that stand in the way of a timely release&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;3. Never a &amp;#8220;one and done&amp;#8221; project&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Iterative approach to process improvement and bpm systems&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;4. Don&amp;#8217;t skip process analysis&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Requirements are not the same as process analysis&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;5. Take time to deliver value&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Taking longer than 90 days to deliver is not a failure&lt;/li&gt;    &lt;li&gt;Use timeline as a box in which to deliver your value&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;6. Build a complete team&lt;/p&gt;  &lt;p&gt;7. Self-sufficiency is a priority&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;FTEs are necessary to build organizational capability&lt;/li&gt;    &lt;li&gt;Partially allocated FTEs are not good enough &amp;#8211; they need to be committed to the project&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;8. Fund to value, not just the first release&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Big challenge as IT funding tends to be per project usually just for a first release&lt;/li&gt;    &lt;li&gt;To obtain the benefits of CPI, maintenance should is not a sleeper like for may be in other applications&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;9. Force collaboration, use playbacks and iterations to create tangible results for frequent validation&lt;/p&gt;  &lt;p&gt;10. Set owners for the program, process, and technology&lt;/p&gt;  &lt;p&gt;Thanks for reading, lots more tomorrow. &lt;/p&gt;  &lt;p&gt;Marius&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8946078" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cisg/archive/tags/Frameworks+and+Platforms/default.aspx">Frameworks and Platforms</category><category domain="http://blogs.msdn.com/cisg/archive/tags/CISG/default.aspx">CISG</category><category domain="http://blogs.msdn.com/cisg/archive/tags/Product+Management/default.aspx">Product Management</category><category domain="http://blogs.msdn.com/cisg/archive/tags/Software+Requirements/default.aspx">Software Requirements</category><category domain="http://blogs.msdn.com/cisg/archive/tags/Program+Management/default.aspx">Program Management</category><category domain="http://blogs.msdn.com/cisg/archive/tags/BPM/default.aspx">BPM</category></item><item><title>UX ≠ UI</title><link>http://blogs.msdn.com/cisg/archive/2008/08/29/ux-ui.aspx</link><pubDate>Fri, 29 Aug 2008 11:09:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8904638</guid><dc:creator>cisg</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/cisg/comments/8904638.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cisg/commentrss.aspx?PostID=8904638</wfw:commentRss><description>&lt;p&gt;Hi Birm here.....&lt;/p&gt;  &lt;p&gt;My name is Ricardo Birmele, but people around here call me &amp;#8220;Birm.&amp;#8221; I am lucky enough to be the user experience (UX) guy on the CISG team. Like many of us working at Microsoft, I&amp;#8217;m an immigrant; in my case flying into the United States from Brasil when I was a kid. In past professional lives I&amp;#8217;ve been a Deputy Sheriff, a newspaper reporter, a book author (I wrote the very first of the &amp;#8220;Idiot&amp;#8217;s Guide&amp;#8221; series), and a software developer. I&amp;#8217;ve won prizes for UI design and for portrait photography. For fun I play a dog house bass in a community orchestra, go golfing, or SCUBA dive. For sanity I commute to work on a motorcycle. I&amp;#8217;ve been a Microsoft FTE for about two and a half years; first running a worldwide training program, and now influencing the user experience effort for CISG. &lt;/p&gt;  &lt;p&gt;Enough about me; let&amp;#8217;s talk about user experience. &lt;/p&gt;  &lt;p&gt;UX is fairly new as cognitive disciplines go. The ideas behind it derive from the sciences of applied psychology, ergonomics, and human factors as practiced by people working in the aircraft industry during World War II. The problem was that equipment then was becoming too complex for people to be able to use it safely. UX began as a way of looking at a collection of entities as being a single object, seeing how that object behaves, and then understanding how people interacted with that object. &lt;/p&gt;  &lt;p&gt;People often take UX as being the same thing as user interface (UI), and that&amp;#8217;s a miscommunication. An application&amp;#8217;s UI certainly has to do with its UX. In truth though, UX as applied to software has to do with &lt;i&gt;everything&lt;/i&gt; you perceive about using an application: how pleasing it looks, how well it works, what information it contains, how easy or difficult it is to use, how well it makes your work easier. In short, how our application appeals to you. Or how it doesn&amp;#8217;t. &lt;/p&gt;  &lt;p&gt;At the end of the day, UX is all about you. &lt;/p&gt;  &lt;p&gt;We start our UX work by researching you and people very much like you. We learn all we can about how you go about your job. What information do you need to do it well? What are your pain points? What are your goals? How exactly would you use an application if we built it? &lt;/p&gt;  &lt;p&gt;Once we have the answers to these questions, we build a persona: an archetype of a user who represents you and the other people very much like you. Notice that I said a persona is an &amp;#8220;archetype&amp;#8221; and not a &amp;#8220;stereotype.&amp;#8221; This is a very important distinction. An archetype is a statistically validated impersonation. Stereotypes are guesses derived from anecdotes. &lt;/p&gt;  &lt;p&gt;Personas let us create scenarios: a sequence of actions we think you will perform as you use our application. Scenarios imply a design for a user interface: the pages containing the controls you use manipulate our application. Once we have user interface design, we ask people like you to test its usability, to make certain that this application solves your problem as intuitively as possible. And so it goes&amp;#8230; &lt;/p&gt;  &lt;p&gt;I think that you can see where I&amp;#8217;m heading with this. &lt;/p&gt;  &lt;p&gt;In upcoming blogs, I&amp;#8217;m going to tell you in detail about all things UX. We&amp;#8217;ll look at everything from UX design to UX research. We&amp;#8217;ll come to understand some of the theories underlying UX. I&amp;#8217;ll show you what makes a good UI design and how to accurately measure usability. We&amp;#8217;ll even go into the science of cognition. And when UX makes the news, we&amp;#8217;ll talk about that too. &lt;/p&gt;  &lt;p&gt;For now though, I hope your take away is the fact that while they&amp;#8217;re similar, user experience is not the same thing as a user interface. &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8904638" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cisg/archive/tags/Frameworks+and+Platforms/default.aspx">Frameworks and Platforms</category><category domain="http://blogs.msdn.com/cisg/archive/tags/CISG/default.aspx">CISG</category></item><item><title>UTF-8 Encoding</title><link>http://blogs.msdn.com/cisg/archive/2008/08/28/utf-8-encoding.aspx</link><pubDate>Thu, 28 Aug 2008 15:53:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8903304</guid><dc:creator>cisg</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/cisg/comments/8903304.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cisg/commentrss.aspx?PostID=8903304</wfw:commentRss><description>&lt;p&gt;Hello there!&lt;/p&gt;  &lt;p&gt;My name is Andreas Fuchsberger, I am a developer in the CISG team based in Germany. I joined CISG after a short stint with Assessment, Consulting and Engineering (ACE) Team part of the InfoSec in Microsoft IT. I am a relatively new to Microsoft having joined only 6 months ago coming from academia where I was full-time academic in the internationally renowned &lt;a href="isg.rhul.ac.uk"&gt;Information Security Group&lt;/a&gt; at Royal Holloway, University of London. In fact I still teach there on the excellent Masters (MSc) degree programme in Information Security, I teach the optional modules on &lt;a href="http://isg.rhul.ac.uk/msc/modules"&gt;Software Security&lt;/a&gt;.&amp;#160; &lt;/p&gt;  &lt;p&gt;The Software Security module was developed in response to the industry need to develop more secure software and is strongly based &lt;a href="http://blogs.msdn.com/michael_howard/"&gt;Michael Howard&lt;/a&gt;&amp;#8216;s must-read book &lt;a href="http://www.microsoft.com/mspress/books/5957.aspx"&gt;Writing Secure Code 2&lt;sup&gt;nd&lt;/sup&gt; Edition&lt;/a&gt; and its update &lt;a href="http://www.microsoft.com/MSPress/books/10723.aspx"&gt;Writing Secure Code for Windows Vista&amp;#174;&lt;/a&gt;. It received part-funding from the Microsoft Research and the syllabus was constructed in consultation with &lt;a href="http://research.microsoft.com/~fabienpe/"&gt;Fabien Peticolas&lt;/a&gt; who headed the then university relations programme and &lt;a href="http://www.tu-harburg.de/sva/html/diego.en.html"&gt;Dieter Gollmann&lt;/a&gt;, who was also Microsoft Research at the time.&amp;#160; Since designing and teaching the course I have become quite passionate about secure coding and the need to educate all kinds of software developers to learn to code securely from early on their careers. I am a true believer that security is not just a bolt-on that can be added at the end of a project. Expect to see more this one of my favorite topics in the future.&lt;/p&gt;  &lt;p&gt;Speaking of secure coding, I note from a recent entry from Michael&amp;#8217;s blog that Apache Tomcat has a UTF-8 encoding security bug and its related to the implementation of a standard (&lt;a href="http://tools.ietf.org/html/rfc3629"&gt;RFC 3629&lt;/a&gt;). Security standards are another of my favourite topics as I actively participate in a number of &lt;a href="http://www.jtc1sc27.din.de/en"&gt;SC27 working groups&lt;/a&gt; (home of the &lt;a href="http://www.27000.org/"&gt;ISO 27000&lt;/a&gt; series) covering IT Security Technique for the &lt;a href="http://www.iso.org/"&gt;International Organisation for Standardisation&lt;/a&gt; (ISO) and the &lt;a href="http://www.iec.ch/"&gt;International Electrotechnical Commission&lt;/a&gt; (IEC). I will be posting updates to the happenings of the working groups in the future.&lt;/p&gt;  &lt;p&gt;Just in case you are interested, the Tomcat vulnerability comes about from using an invalid but possible UTF-8 encoding of &amp;#8216;.&amp;#8217; character, this bug is often called &amp;#8220;overlong UTF-8 escape&amp;quot;. BTW the definitive place for&amp;#160; UTF-8 encoding is Section 2.5 &amp;#8220;&lt;a href="http://www.unicode.org/versions/Unicode5.0.0/ch02.pdf#G13708"&gt;Encoding Forms&lt;/a&gt;&amp;#8221; and Section 3.9 &amp;#8220;&lt;a href="http://www.unicode.org/versions/Unicode5.0.0/ch03.pdf#G7404"&gt; Unicode Encoding Forms&lt;/a&gt; &amp;#8221; in the &lt;a href="http://www.unicode.org/versions/Unicode5.0.0/"&gt;Unicode Standard&lt;/a&gt;, a great read if you interested in typesetting, character sets, encoding an similar. This particular problem comes about through the desire create a solution that provides some form of compatibility for legacy systems, a source of many security problems.&amp;#160; It also goes to show that using blacklists is not the safest way to check for invalid input. Hackers always seem to be able to find new ways around blacklists that the original designers could not envisage. This is one the many things we are currently contemplating in the design of our new Anti-XSS library.&amp;#160; Watch this space for an announcement.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8903304" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cisg/archive/tags/Frameworks+and+Platforms/default.aspx">Frameworks and Platforms</category><category domain="http://blogs.msdn.com/cisg/archive/tags/Anti-XSS/default.aspx">Anti-XSS</category><category domain="http://blogs.msdn.com/cisg/archive/tags/Royal+Holloway/default.aspx">Royal Holloway</category><category domain="http://blogs.msdn.com/cisg/archive/tags/CISG/default.aspx">CISG</category></item><item><title>What Does ANTI-XSS Offer for HTML Sanitization?</title><link>http://blogs.msdn.com/cisg/archive/2008/08/27/what-does-anti-xss-offer-for-html-sanitization.aspx</link><pubDate>Wed, 27 Aug 2008 22:41:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8901229</guid><dc:creator>cisg</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/cisg/comments/8901229.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cisg/commentrss.aspx?PostID=8901229</wfw:commentRss><description>&lt;P&gt;Hi Vineet here.....&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;My name is Vineet Batta and in keeping with the other introductions here are a few words about myself. I have an engineering degree in Electronics &amp;amp; Communication and have spent quite a lot of time doing security reviews in the application space. Before joining Microsoft as an FTE I worked as a consultant to different teams including TWC and MSN operations. As an FTE I have worked extensively on&amp;nbsp; the Threat Modeling and Analysis Enterprise tool since 2007. I have always enjoyed breaking applications to expose security vulnerabilities and then designing creative solutions to fix them.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;My favourite phrase of the moment is;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;"&lt;EM&gt;Social engineering bypasses all technologies, including firewalls&lt;/EM&gt;"&lt;/P&gt;
&lt;P&gt;To support rich user experiences, increasingly web applications are required to input data in a rich text format. That means the ability to apply formatting basics&amp;nbsp; like bold, color, embedding hyperlinked URL's etc. This can however lead to potential XSS exploits from vulnerabilities, if a malicious payload is embedded in this rich text.&lt;/P&gt;
&lt;P&gt;Content filtering is one of the most important steps we can take to protect our customers and this filtering must apply to all user content which will be displayed in the software client. Items stored in a user’s data store can sometimes inadvertently contain nasty attack vectors, referred to as Persistent Cross Site Scripting. It is the client’s responsibility to protect the user and the users system from these attacks. &lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;The Anti-XSS library also sanitizes tainted/unsafe HTML and emits "safe HTML". In its processing it makes formatting changes that means if the HTML document is not well formed (unbalanced tags or missing tags), it will correct it. To output safe HTM a&amp;nbsp; white list based approach is used. The Anti-XSS library addresses these issues by exposing SafeHtml and SafeHtmlFragment methods.&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;Example 1: Usage of &lt;FONT size=2 face="Courier New"&gt;&lt;U&gt;SafeHtml&lt;/U&gt;&lt;/FONT&gt; method.&lt;/STRIKE&gt;&lt;/P&gt;
&lt;TABLE border=1 cellSpacing=0 cellPadding=2 width=1164&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=1162&gt;&lt;STRIKE&gt;If the input HTML stream is &lt;BR&gt;&lt;BR&gt;&lt;/STRIKE&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: 50.14%; PADDING-RIGHT: 4px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; HEIGHT: 220px; 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, 'Courier New', 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, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;STRIKE&gt;&lt;SPAN style="COLOR: #606060"&gt;   1:&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;html&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/STRIKE&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, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;STRIKE&gt;&lt;SPAN style="COLOR: #606060"&gt;   2:&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;head&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/STRIKE&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, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;STRIKE&gt;&lt;SPAN style="COLOR: #606060"&gt;   3:&lt;/SPAN&gt;     &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;title&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;CISG test page&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;title&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/STRIKE&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, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;STRIKE&gt;&lt;SPAN style="COLOR: #606060"&gt;   4:&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;head&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/STRIKE&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, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;STRIKE&gt;&lt;SPAN style="COLOR: #606060"&gt;   5:&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;body&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/STRIKE&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, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;STRIKE&gt;&lt;SPAN style="COLOR: #606060"&gt;   6:&lt;/SPAN&gt;     &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;table&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/STRIKE&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, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;STRIKE&gt;&lt;SPAN style="COLOR: #606060"&gt;   7:&lt;/SPAN&gt;         &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;tr&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/STRIKE&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, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;STRIKE&gt;&lt;SPAN style="COLOR: #606060"&gt;   8:&lt;/SPAN&gt;             &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;td&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/STRIKE&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, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;STRIKE&gt;&lt;SPAN style="COLOR: #606060"&gt;   9:&lt;/SPAN&gt;                 XSS TEST &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;a&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; My mail box &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;script&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/STRIKE&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, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;STRIKE&gt;&lt;SPAN style="COLOR: #606060"&gt;   1:&lt;/SPAN&gt;  type=&lt;SPAN style="COLOR: #006080"&gt;'text/javascript'&lt;/SPAN&gt; &amp;gt; alert(&lt;SPAN style="COLOR: #006080"&gt;"BAD CODE"&lt;/SPAN&gt;);" &lt;/STRIKE&gt;&lt;/PRE&gt;&lt;STRIKE&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;script&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;a&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/STRIKE&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, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;STRIKE&gt;&lt;SPAN style="COLOR: #606060"&gt;  10:&lt;/SPAN&gt;                 &lt;SPAN style="COLOR: #008000"&gt;&amp;lt;!-- There is a script injection as above. --&amp;gt;&lt;/SPAN&gt;&lt;/STRIKE&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, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;STRIKE&gt;&lt;SPAN style="COLOR: #606060"&gt;  11:&lt;/SPAN&gt;                 &lt;SPAN style="COLOR: #008000"&gt;&amp;lt;!-- The closing &amp;lt;td&amp;gt; element is missing. --&amp;gt;&lt;/SPAN&gt;&lt;/STRIKE&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, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;STRIKE&gt;&lt;SPAN style="COLOR: #606060"&gt;  12:&lt;/SPAN&gt;         &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;tr&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/STRIKE&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, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;STRIKE&gt;&lt;SPAN style="COLOR: #606060"&gt;  13:&lt;/SPAN&gt;     &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;table&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/STRIKE&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, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;STRIKE&gt;&lt;SPAN style="COLOR: #606060"&gt;  14:&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;body&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/STRIKE&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, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;STRIKE&gt;&lt;SPAN style="COLOR: #606060"&gt;  15:&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;html&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/STRIKE&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;U&gt;&lt;BR&gt;&lt;STRIKE&gt;Note the following: &lt;/STRIKE&gt;&lt;/U&gt;&lt;BR&gt;&lt;STRIKE&gt;1. The html has closing&amp;lt;td&amp;gt; element missing. &lt;BR&gt;2. The already injected script is part of the input stream &lt;BR&gt;&lt;/STRIKE&gt;&lt;STRIKE&gt;&lt;FONT size=2 face="Courier New"&gt;&amp;lt;script type="text/javascript" &amp;gt; alert("BAD CODE"); &amp;lt;/script&amp;gt; &lt;BR&gt;&lt;/FONT&gt;&lt;BR&gt;Call one of the GetSafeHtml() methods from overloaded list as below: &lt;BR&gt;&lt;BR&gt;&lt;/STRIKE&gt;&lt;STRIKE&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#0000ff&gt;AntiXss&lt;/FONT&gt;.GetSafeHtml(stringReader, stringWriter); &lt;BR&gt;&lt;FONT color=#008000&gt;//stringWriter will hold the output.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;BR&gt;&lt;BR&gt;&lt;/STRIKE&gt;
&lt;P&gt;&lt;STRIKE&gt;The output will be well formed HTML and that is (X)HTML compliant&lt;/STRIKE&gt;&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: 49.75%; PADDING-RIGHT: 4px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; HEIGHT: 210px; 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, 'Courier New', 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, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;STRIKE&gt;&lt;SPAN style="COLOR: #606060"&gt;   1:&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;html&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/STRIKE&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, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;STRIKE&gt;&lt;SPAN style="COLOR: #606060"&gt;   2:&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;head&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/STRIKE&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, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;STRIKE&gt;&lt;SPAN style="COLOR: #606060"&gt;   3:&lt;/SPAN&gt;     &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;title&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;CISG test page&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;title&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/STRIKE&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, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;STRIKE&gt;&lt;SPAN style="COLOR: #606060"&gt;   4:&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;head&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/STRIKE&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, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;STRIKE&gt;&lt;SPAN style="COLOR: #606060"&gt;   5:&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;body&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/STRIKE&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, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;STRIKE&gt;&lt;SPAN style="COLOR: #606060"&gt;   6:&lt;/SPAN&gt;     &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;table&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/STRIKE&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, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;STRIKE&gt;&lt;SPAN style="COLOR: #606060"&gt;   7:&lt;/SPAN&gt;         &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;tr&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/STRIKE&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, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;STRIKE&gt;&lt;SPAN style="COLOR: #606060"&gt;   8:&lt;/SPAN&gt;             &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;td&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/STRIKE&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, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;STRIKE&gt;&lt;SPAN style="COLOR: #606060"&gt;   9:&lt;/SPAN&gt;                 XSS TEST &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;a&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt; My mail box &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;a&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/STRIKE&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, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;STRIKE&gt;&lt;SPAN style="COLOR: #606060"&gt;  10:&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008000"&gt;&amp;lt;!-- There was script that is purged from the output. --&amp;gt;&lt;/SPAN&gt;&lt;/STRIKE&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, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;STRIKE&gt;&lt;SPAN style="COLOR: #606060"&gt;  11:&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008000"&gt;&amp;lt;!-- The closing &amp;lt;td&amp;gt; element is NOT missing. --&amp;gt;&lt;/SPAN&gt;&lt;/STRIKE&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, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;STRIKE&gt;&lt;SPAN style="COLOR: #606060"&gt;  12:&lt;/SPAN&gt;             &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;td&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/STRIKE&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, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;STRIKE&gt;&lt;SPAN style="COLOR: #606060"&gt;  13:&lt;/SPAN&gt;         &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;tr&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/STRIKE&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, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;STRIKE&gt;&lt;SPAN style="COLOR: #606060"&gt;  14:&lt;/SPAN&gt;     &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;table&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/STRIKE&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, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;STRIKE&gt;&lt;SPAN style="COLOR: #606060"&gt;  15:&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;body&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/STRIKE&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, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;STRIKE&gt;&lt;SPAN style="COLOR: #606060"&gt;  16:&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #800000"&gt;html&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/STRIKE&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;STRIKE&gt;That's it , so easy to use and useful . :-). Note that even if &amp;lt;html&amp;gt;&amp;lt;body&amp;gt; were&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; to be missing from input stream, call to this method would have added these to form&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a well form HTML document.&lt;/STRIKE&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P&gt;&lt;STRIKE&gt;Example 2: Usage of &lt;FONT size=2 face="Courier New"&gt;&lt;U&gt;SafeHtmlFragment&lt;/U&gt;&lt;/FONT&gt; method.&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;As the name suggest SafeHtmlFragment is used if you must output only a fragment of the HTML body content and not the entire HTML document.The method will not output any &amp;lt;html&amp;gt;&amp;lt;body&amp;gt; elements if they are missing.&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;Consider the unsafe input as below:&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;STRIKE&gt;&lt;FONT color=#0000ff&gt;&amp;lt;&lt;/FONT&gt;a &lt;FONT color=#800000&gt;href&lt;/FONT&gt;="http://www.contoso.com"&lt;FONT color=#0000ff&gt;&amp;gt;&lt;/FONT&gt; You won the lottery &lt;FONT color=#0000ff&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000&gt;script language&lt;/FONT&gt;="javascript" &lt;FONT color=#0000ff&gt;&amp;gt; &lt;/FONT&gt;var a = document.cookie; &lt;BR&gt;&lt;FONT color=#0000ff&gt;&amp;lt;&lt;/FONT&gt;/&lt;FONT color=#800000&gt;script&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;&amp;gt; &amp;lt;/&lt;/FONT&gt;a&lt;FONT color=#0000ff&gt;&amp;gt;&lt;/FONT&gt;&lt;/STRIKE&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;Call one of the GetSafeHtmlFragment methods from overloaded list as below:&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR&gt;&lt;STRIKE&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#0000ff&gt;AntiXss&lt;/FONT&gt;.GetSafeHtmlFragment(stringReader, stringWriter); &lt;BR&gt;&lt;FONT color=#008000&gt;//stringWriter will hold the output.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;BR&gt;&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;The output will be:&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;STRIKE&gt;&lt;FONT color=#0000ff&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000&gt;div&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;&amp;gt; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000&gt;a href&lt;/FONT&gt;="http://www.contoso.com"&lt;FONT color=#0000ff&gt;&amp;gt;&lt;/FONT&gt; You won the lottery &lt;FONT color=#0000ff&gt;&amp;lt;&lt;/FONT&gt;/&lt;FONT color=#800000&gt;a&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;&amp;gt; &amp;lt;/&lt;/FONT&gt;&lt;FONT color=#800000&gt;div&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;&amp;gt;&lt;/FONT&gt;&lt;/STRIKE&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;STRIKE&gt;&lt;/STRIKE&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;STRIKE&gt;&lt;/STRIKE&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;STRIKE&gt;As you can see the output is rendered harmless and valid.&lt;/STRIKE&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;STRIKE&gt;It is worth nothing that this approach is different from HTMLEncoding. In encoding all unsafe characters are encoded to be rendered as harmless characters in the users browser. Using SafeHtmlFragment you actually purge the dangerous/unsafe script and replace it with white spaces.&lt;/STRIKE&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;More from me next week when we start to explore the next generation of Anti- XSS technology we are working on.&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8901229" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cisg/archive/tags/Frameworks+and+Platforms/default.aspx">Frameworks and Platforms</category><category domain="http://blogs.msdn.com/cisg/archive/tags/Anti-XSS/default.aspx">Anti-XSS</category><category domain="http://blogs.msdn.com/cisg/archive/tags/CISG/default.aspx">CISG</category></item><item><title>What is the Microsoft Anti-XSS Library?</title><link>http://blogs.msdn.com/cisg/archive/2008/08/26/what-is-microsoft-antixss.aspx</link><pubDate>Tue, 26 Aug 2008 11:05:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8896623</guid><dc:creator>cisg</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.msdn.com/cisg/comments/8896623.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cisg/commentrss.aspx?PostID=8896623</wfw:commentRss><description>&lt;p&gt;RV here.....&lt;/p&gt;  &lt;p&gt;My full name is Anil Kumar Venkata Revuru but people call me RV around here. I am a Senior Software Development Engineer (SDE in MSFT speak) for CISG where I am responsible for architecting security tools. In my past life at Microsoft I conducted security design reviews, threat modeling, application and source-code assessments. I hold a Diploma in Mechanical Engineering from JNTU Hyderabad and I made significant contribution to the security development of products at V-Empower Inc. I am also the author of Microsoft Threat Analysis and Modeling Tool used for application threat modeling. You can find my personal blog at &lt;a href="http://blogs.msdn.com/codejunkie"&gt;http://blogs.msdn.com/codejunkie&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;For my first post I thought I would provide an overview of the Anti-XSS library as it stands today. As Mark mentioned in the first post we have a team working on the next generation of this technology and well be blogging about that in the coming weeks. The &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=efb9c819-53ff-4f82-bfaf-e11625130c25&amp;amp;displaylang=en"&gt;Microsoft Anti Cross Site Scripting Library (AntiX&lt;font color="#acb613"&gt;SS&lt;/font&gt;)&lt;/a&gt; is an encoding library, designed and developed by CISG team at Microsoft in conjunction with the ACE Team. It is designed to help developers protect their Web-based applications from XSS attacks. This library is very different from most encoding libraries, it uses the principle-of-inclusions technique to provide protection against XSS attacks. This approach works by defining a valid or allowable set of characters, and encoding anything outside this set (invalid characters or potential attacks). It offers several advantages over other encoding schemes.&lt;/p&gt;  &lt;p&gt;AntiXSS library encoding scheme uses the following white list for passing the safe characters and will encode all other characters. &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;a-z, A-Z, 0-9 &lt;/li&gt;    &lt;li&gt;space, period, comma, hyphen and underscore &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Before we look at how AntiXSS works, lets look at a potential cross site scripting defect and understand how it works. Cross site scripting (XSS) is the most common web application vulnerability and is listed in the &lt;a href="http://www.owasp.org/index.php/Top_10_2007"&gt;Top 10 web application vulnerabilities on OWASP&lt;/a&gt;. XSS can also be called HTML injection attack, it occurs when un-validated user input is inserted into HTML output. This allows the attacker to construct a URL with HTML input and get it executed on the browser in the user's context. This attack can be used to extract cookie information, steal sessions, write new html tags, invoke ActiveX controls, etc. Essentially, anything that can be done with a browser can be done with this attack without the user's knowledge. &lt;/p&gt;  &lt;p&gt;Many of ASP.NET controls don't encode the input natively, which makes it more important for the developer to encode or validate the input. The following are some examples of this vulnerability.&lt;/p&gt;  &lt;div&gt;   &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;     &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #008000"&gt;//This is the classic XSS vulnerability. &lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; Response.Write(Request.Params[&lt;span style="color: #006080"&gt;&amp;quot;input&amp;quot;&lt;/span&gt;]);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt; &lt;span style="color: #008000"&gt;//Here is another vulnerability using ASP.NET controls&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt; Label1.Text = Request.QueryString[&lt;span style="color: #006080"&gt;&amp;quot;message&amp;quot;&lt;/span&gt;];&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;In the above examples, the input is being direct passed back to output stream. If any HTML such as &lt;em&gt;&amp;lt;script&amp;gt;alert('Hello')&amp;lt;/script&amp;gt;&lt;/em&gt; will be executed the browser and you will see a message box. Most probably this exploit may be stopped by request validation feature of .NET. There are other exploits which will bypass request validation feature, this feature should be used for defense in depth. &lt;/p&gt;

&lt;p&gt;Proper output encoding and good input validation will fix the XSS issue. For output encoding use AntiXSS Library for its comprehensive encoding capabilities. AntiXSS works by looking at all the characters in the input and encoding characters not in the whitelist using standard html entity notation (&amp;amp;#num;). The above script would get encoded as &amp;amp;#60;script&amp;amp;#62;alert&amp;amp;#40;&amp;amp;#39;hello&amp;amp;#39;&amp;amp;#41;&amp;amp;#59;&amp;amp;#60;&amp;amp;#47;script&amp;amp;#62;. The following code is the correct implementation of AntiXSS for the above vulnerabilities.&lt;/p&gt;

&lt;div&gt;
  &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;
    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #008000"&gt;//This is the classic XSS vulnerability.&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; Response.Write(AntiXss.HtmlEncode(Request.Params[&lt;span style="color: #006080"&gt;&amp;quot;input&amp;quot;&lt;/span&gt;])); &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt; &lt;span style="color: #008000"&gt;//Here is another vulnerability using ASP.NET controls&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt; Label1.Text = AntiXss.HtmlEncode(Request.QueryString[&lt;span style="color: #006080"&gt;&amp;quot;message&amp;quot;&lt;/span&gt;]);&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Also there are different encoding methods for different context's. For example, if you constructing a URL from user input you should use &lt;em&gt;AntiXss.UrlEncode.&lt;/em&gt; The following are different context's and examples.&lt;/p&gt;

&lt;div&gt;
  &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;
    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #008000"&gt;//HTML Attribute Context&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; Literal1.Text = &lt;span style="color: #006080"&gt;&amp;quot;&amp;lt;hr noshade size=&amp;quot;&lt;/span&gt; + &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;         AntiXss.HtmlAttributeEncode(TextBox1.Text) + &lt;span style="color: #006080"&gt;&amp;quot;&amp;gt;&amp;quot;&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt; &lt;span style="color: #008000"&gt;//URL Context&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt; String SearchUrl = &lt;span style="color: #006080"&gt;&amp;quot;http://search.live.com/results.aspx?q=&amp;quot;&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt; Literal1.Text = &lt;span style="color: #006080"&gt;&amp;quot;&amp;lt;a href=\&amp;quot;&amp;quot;&lt;/span&gt; + SearchUrl + AntiXss.UrlEncode(TextBox1.Text) +   &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;                 &lt;span style="color: #006080"&gt;&amp;quot;\&amp;quot;&amp;gt;Example Link&amp;lt;/a&amp;gt;&amp;quot;&lt;/span&gt;;   &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt; &lt;span style="color: #008000"&gt;//JavaScript Context&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt; StringBuilder Str = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; StringBuilder();  &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt; Str.Append(&lt;span style="color: #006080"&gt;&amp;quot;&amp;lt;script type=\&amp;quot;text/javascript\&amp;quot;&amp;gt;\n&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt; StringArrayConverter StrArrayConv = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; StringArrayConverter(); &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;[] ItemsArray = (&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;[])StrArrayConv.ConvertFrom(TextBox1.Text);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  15:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;foreach&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; item &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; ItemsArray) &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  16:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  17:&lt;/span&gt;     &lt;span style="color: #008000"&gt;// Note that JavaScriptEncode adds the starting and end ' &lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  18:&lt;/span&gt;     &lt;span style="color: #008000"&gt;//so we don't need to include them in the code&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  19:&lt;/span&gt;     Str.Append(&lt;span style="color: #006080"&gt;&amp;quot;listboxItems.push(&amp;quot;&lt;/span&gt; + &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  20:&lt;/span&gt;     Microsoft.Security.Application.AntiXss.JavaScriptEncode(item) + &lt;span style="color: #006080"&gt;&amp;quot;);\n&amp;quot;&lt;/span&gt;);  &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  21:&lt;/span&gt; }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  22:&lt;/span&gt; Str.Append(&lt;span style="color: #006080"&gt;&amp;quot;FillListBox();\n&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  23:&lt;/span&gt; Str.Append(&lt;span style="color: #006080"&gt;&amp;quot;&amp;lt;/script&amp;gt;&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  24:&lt;/span&gt; Literal1.Text = Str.ToString();&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  25:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  26:&lt;/span&gt; &lt;span style="color: #008000"&gt;//XML context&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  27:&lt;/span&gt; &lt;span style="color: #008000"&gt;// Create XML template&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  28:&lt;/span&gt; String Xml = &lt;span style="color: #006080"&gt;&amp;quot;&amp;lt;xml id=\&amp;quot;data\&amp;quot;&amp;gt;\n&amp;lt;data&amp;gt;\n&amp;lt;name&amp;gt;{0}&amp;lt;/name&amp;gt;\n&amp;quot;&lt;/span&gt; +&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  29:&lt;/span&gt;      &lt;span style="color: #006080"&gt;&amp;quot;&amp;lt;company&amp;gt;{1}&amp;lt;/company&amp;gt;\n&amp;lt;email&amp;gt;{2}&amp;lt;/email&amp;gt;\n&amp;quot;&lt;/span&gt; +&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  30:&lt;/span&gt;      &lt;span style="color: #006080"&gt;&amp;quot;&amp;lt;/data&amp;gt;\n&amp;lt;/xml&amp;gt;\n&amp;quot;&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  31:&lt;/span&gt; &lt;span style="color: #008000"&gt;// Fill template with data provided by user&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  32:&lt;/span&gt; Literal1.Text = String.Format(Xml, &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;[] &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  33:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  34:&lt;/span&gt;     Microsoft.Security.Application.AntiXss.XmlEncode(TextBox1.Text),&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  35:&lt;/span&gt;     Microsoft.Security.Application.AntiXss.XmlEncode(TextBox2.Text),&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  36:&lt;/span&gt;     Microsoft.Security.Application.AntiXss.XmlEncode(TextBox3.Text)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  37:&lt;/span&gt; });&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;As you see, for specific context you should use that method as each context defines specific encoding pattern. Further information on the usage of AntiXSS is available on MSDN at &lt;a title="http://msdn.microsoft.com/en-us/library/aa973813.aspx" href="http://msdn.microsoft.com/en-us/library/aa973813.aspx"&gt;http://msdn.microsoft.com/en-us/library/aa973813.aspx&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;We are working on some significant updates to the library and building some complimentary technology. More from me on that in the coming weeks!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8896623" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cisg/archive/tags/Frameworks+and+Platforms/default.aspx">Frameworks and Platforms</category><category domain="http://blogs.msdn.com/cisg/archive/tags/OWASP/default.aspx">OWASP</category><category domain="http://blogs.msdn.com/cisg/archive/tags/Anti-XSS/default.aspx">Anti-XSS</category><category domain="http://blogs.msdn.com/cisg/archive/tags/CISG/default.aspx">CISG</category></item><item><title>Welcome to the CISG Blog</title><link>http://blogs.msdn.com/cisg/archive/2008/08/25/test.aspx</link><pubDate>Mon, 25 Aug 2008 13:49:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8893684</guid><dc:creator>cisg</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/cisg/comments/8893684.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cisg/commentrss.aspx?PostID=8893684</wfw:commentRss><description>&lt;p&gt;Mark Curphey here......&lt;/p&gt;  &lt;p&gt;I am the Product Unit Manager (or &amp;quot;PUM&amp;quot; in MSFT speak) for the Connected Information Security Group or CISG. Welcome to our new team blog. We are a software development team of about 35 developers, program managers and testers that supports Microsoft's corporate information security program; itself part of Microsoft IT and I manage the team. We are responsible for designing and building software to support the information security program, a lot of which is or will be released to our customers and the public in general as well as being deployed for our own use. We have built and support a broad portfolio of technology ranging from identity management solutions, security scanning tools, threat modelling tools and development libraries and will be focusing on the security management space in FY09. &lt;/p&gt;  &lt;p&gt;You will be hearing a lot more about what we think will be &amp;quot;the next big thing&amp;quot; and about big projects we are working on over the coming months but for the first month or so we plan to share our thoughts and plans to update the Anti-XSS library (and probably some associated tools). &lt;/p&gt;  &lt;p&gt;This week well be posting introductions from the team working on Anti-XSS including developers, program managers and a UX designer. From next week onwards well launch into detailed posts on the project that will generally fit into three main categories;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Team and Program Management&lt;/li&gt;    &lt;li&gt;Technical Design and Development&lt;/li&gt;    &lt;li&gt;User Experience (UX) &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Myself and the program managers will share information about how we organize projects, set up Visual Studio Team System to support our development, how we use AGILE and SCRUMM and other program management techniques to track our work as well as discussing the high level project design ideas and industry challenges. The developers themselves will share deep technical and code level thoughts and ideas on the problems they are tackling and our UX guy will explain our thoughts and plans around user experience including developing personas, UI and documentation. &lt;/p&gt;  &lt;p&gt;In keeping with the introductions that will follow from other members of the Anti-XSS project team this week here is a short bio about me. &lt;/p&gt;  &lt;p&gt;I graduated from &lt;a href="http://isg.rhul.ac.uk/"&gt;Royal Holloway, University of London&lt;/a&gt; with a Masters degree in Information Security in the mid-nineties as a mature student; a little late to the party after a &amp;quot;misspent youth&amp;quot;! Royal Holloway is most recently famous as the cryptography school where the cryptographer &lt;a href="http://en.wikipedia.org/wiki/Sophie_Neveu"&gt;Sophie Neveu&lt;/a&gt; was educated in the best selling novel &amp;#8220;The Da&amp;#8217;Vinci Code&amp;#8221;. After spending several years working at various investment banks in the City of London working on a variety of technical projects including PKI design, Windows NT security, policy development and single sign-on systems, I moved to Atlanta to run a consulting team performing security assessments at Internet Security Systems (now IBM). In late 2000 I took a job at Charles Schwab to create and manage the software security program, essentially creating the equivalent of the SDL program.&amp;#160; It was during this period of my life that I started &lt;a href="www.owasp.org"&gt;OWASP&lt;/a&gt;, the Open Web Application Project which now has over 10,000 members globally and is recommended reading by the Federal Trade Commission and the National Institute for Standards (NIST). In 2003 I joined a small startup called &lt;a href="http://www.foundstone.com/"&gt;Foundstone&lt;/a&gt; to take the experience learnt at Schwab to other Fortune 1000 companies. The company was sold to McAfee in October 2004 and I joined the McAfee executive team reporting directly to the President continuing to run the consulting business. I was awarded the Microsoft MVP for Visual Developer Security in 2005. &lt;/p&gt;  &lt;p&gt;In late 2006 I left Foundstone and the States, moved back to Europe and took some timeout to think seriously about designing and developing an information security management platform, work that is continuing in CISG today. I enjoy speaking at conferences, have contributed to several MS Press security books and have worked with the Patterns and Architecture Group (PAG) on threat modelling and code review guidance. I am currently writing a chapter for the &lt;a href="http://www.amazon.com/Beautiful-Security-John-Viega/dp/0596527489"&gt;O'Reilly book Beautiful Security&lt;/a&gt; on designing and building the next generation of security management technology.&amp;#160; I have a personal security blog at &lt;a href="http://www.securitybuddha.com"&gt;http://www.securitybuddha.com&lt;/a&gt; and am a recent &amp;quot;mid-life crisis&amp;quot; convert to jogging and kite flying.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8893684" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cisg/archive/tags/Frameworks+and+Platforms/default.aspx">Frameworks and Platforms</category><category domain="http://blogs.msdn.com/cisg/archive/tags/OWASP/default.aspx">OWASP</category><category domain="http://blogs.msdn.com/cisg/archive/tags/Anti-XSS/default.aspx">Anti-XSS</category><category domain="http://blogs.msdn.com/cisg/archive/tags/Royal+Holloway/default.aspx">Royal Holloway</category><category domain="http://blogs.msdn.com/cisg/archive/tags/CISG/default.aspx">CISG</category></item></channel></rss>