Anti-Cross Site Scripting Library (RETIRED)http://forums.asp.net/1107.aspx/1?Anti+Cross+Site+Scripting+Library+RETIRED+Discuss the Anti-Cross Site Scripting Library Note : This forum was retired on Monday July 12, 2010, and is now read-only. More InformationTue, 01 Jun 2010 12:48:16 -0400urn:uuid:00000000-0000-0000-0000-000000001107urn:uuid:00000000-0000-0000-0000-000003889538http://forums.asp.net/p/1564186/3889538.aspx/1?quick+question+on+Anti+xss+libraryquick question on Anti xss library &lt;div id=ctl00_MainPlaceHolder_EntryList_ctl01_EntryTemplate_BodyLabel&gt; <p>Hi all,</p> <p>&nbsp;</p> <p>&nbsp;&nbsp; Can anybody please tell or guide me on whether we can use Anti XSS library 3.1 on ASP applications?.</p> <p>&nbsp;&nbsp;&nbsp; Please point me to an article&nbsp;if you know of something.</p> <p>&nbsp;</p> <p>Thanks for any help,</p> <p>Kumar Pindiprolu.</p> &lt;/div&gt; 2010-06-01T13:54:15-04:002010-06-01T13:54:15.623-04:00urn:uuid:00000000-0000-0000-0000-000003822519http://forums.asp.net/p/1555291/3822519.aspx/1?Whitelist+Blacklist+Whitelist/Blacklist <p>It says that the library has an ability to specify whilist/blacklist tags in its description, however there are no examples and I couldn't find anything like that in dll file.<br> </p> 2010-05-07T00:18:56-04:002010-05-07T00:18:56.87-04:00urn:uuid:00000000-0000-0000-0000-000003652756http://forums.asp.net/p/1520575/3652756.aspx/1?using+Antixss+dll+in+VS+2005using Antixss dll in VS 2005 <p>Hi,</p> <p>I want to use the AntiXSS&nbsp;library dll in my project. I downloaded the AntiXSS library.</p> <p>But when i try to add the reference, I am not able to find the dll. I am also not getting the Microsoft.security.</p> <p>What am i missing? How to add the Antixss library in the reference.</p> <p>Thank you&nbsp;</p> 2010-02-01T11:39:54-05:002010-02-01T11:39:54.59-05:00urn:uuid:00000000-0000-0000-0000-000003652754http://forums.asp.net/p/1520574/3652754.aspx/1?checking+cross+site+scripting+in+javascriptchecking cross site scripting in javascript <p>Hi,</p> <p>I have the following lines&nbsp;of code in my javascript. </p> <pre class="prettyprint">function test() { var Frameobj=document.getElementById('Frame1'); if(((Frameobj != null) &amp;&amp; (Frameobj != &quot;&quot;) &amp;&amp; (Frameobj != &quot;undefined&quot;))) { Frameobj.src=window.location.toString().substr(0,window.location.toString().lastIndexOf('/')) &#43; '/Names.aspx'; } }</pre> <p><br> &nbsp;</p> <p><br> &nbsp;How to check the cross site scripting for the above lines?</p> <p>Thank you.</p> 2010-02-01T11:37:17-05:002010-02-01T11:37:17.963-05:00urn:uuid:00000000-0000-0000-0000-000003607999http://forums.asp.net/p/1512444/3607999.aspx/1?Adding+AntiXSS+to+an+existing+projectAdding AntiXSS to an existing project <p>Hi,&nbsp;</p> <p>&nbsp;&nbsp; I'm nearing the end of my project and have been using HTML Enconding and URL Encoding to sanitize my input. However, I've just come across Microsoft's AntiXSS library and found that it could be quite useful. However, I don't want to restart my project (in terms of sanitization). Does anyone have any experience on retrospectively adding AntiXSS to an existing ASP.NET web app? Is it quite a straightforward process of replacing any HTML ecoding with the AntiXSS namespace? If so, I plan to implement the AntiXSS after production has gone live (Due to time constraints).</p> <p>Thanks</p> <p><br> </p> 2010-01-09T22:45:38-05:002010-01-09T22:45:38.12-05:00urn:uuid:00000000-0000-0000-0000-000003544551http://forums.asp.net/p/1499650/3544551.aspx/1?SQL+Injection+with+AntiXssSQL Injection with AntiXss <p>Hi all,</p> <p>I'm new with the AntiXss.</p> <p>Can someone tell me which function in AntiXss I can use to prevent SQL injection?</p> <p>&nbsp;</p> <p>Thanks</p> 2009-12-02T19:41:46-05:002009-12-02T19:41:46.66-05:00urn:uuid:00000000-0000-0000-0000-000003518683http://forums.asp.net/p/1494134/3518683.aspx/1?Microsoft+Anti+Cross+Site+Scripting+Library+V1+5+taking+longer+to+load+first+time+in+appMicrosoft Anti-Cross Site Scripting Library V1.5 taking longer to load first time in app <p>Hi All,</p> <p>We are using <b>Microsoft Anti-Cross Site Scripting Library V1.5</b>&nbsp;dll for encoding the few character in the cookie values, and recently we observed one perfromance issue while loading the first page of application. I further analysed each line of code to get the exact root cause of delay (almost 15 sec), and came to conclusion that the method <strong>(AntiXss.UrlEncode(Title)</strong>&nbsp;invoked from one of the wrapper component of application is executing as expected, however the wrapper component API is taking almost 15 sec to start executing this method.</p> <p>Further again I directly inlcuded <strong>AntiXss.UrlEncode(Title) </strong>method in code, but again I observed wherever&nbsp;I have reference of this AntiXss Library dll reference and the first hit to that code is taking 15 sec, additioanaly this only happens at the first time after IIS Restart, further calls works as expected.</p> <p>I am going to try replaceing the new 3.0 version of AntiXss Library, but wanted to know the root cause of this issue if any one have faced this before.</p> <p>Thanks!!</p> 2009-11-18T00:07:42-05:002009-11-18T00:07:42.78-05:00urn:uuid:00000000-0000-0000-0000-000003506534http://forums.asp.net/p/1491433/3506534.aspx/1?GET+and+POST+InterchangeableGET and POST Interchangeable <p>Hi,</p> <p>My web application runs on IIS7 and Windows Server 2008. Right now, we are facing an issue where the&nbsp;application was found to accept parameters using the GET and POST HTTP Methods interchangeably. This provides 2 distinct methods for providing input to the application and can make certain attacks more viable.</p> <p>For example, if an attacker found a POST parameter which was vulnerable to cross site scripting(XSS),&nbsp; and GET and POST requests were interchangeable, the XSS attack could be performed via GET instead, allowing them to create a URL to send to potential victims.</p> <p>I would be glad if someone could help me to resolve this issue.</p> <p>Regards,</p> <p>Sunitha</p> 2009-11-11T11:21:53-05:002009-11-11T11:21:53.82-05:00urn:uuid:00000000-0000-0000-0000-000003497581http://forums.asp.net/p/1489677/3497581.aspx/1?Use+of+AntiXss+with+Infragistics+ControlsUse of AntiXss with Infragistics Controls <p>Hi</p> <p>We have an application which was developed with infragistic controls. Right now we are planning to apply security to it, we need to stop the cross-site scripting (XSS). Since&nbsp; this particular application has&nbsp;many screens and, we dont want to go and touch each and every screen we planned to use AntiXSS security runtime engine, by configuring the controls to its antixssmodule.config file. </p> <p><br> 1) Infragistics WebTextEdit control is working fine, but we have trouble with couple of controls i.e. in the Infragistics UltraWebGrid &amp; WebCombo. Please suggest what can be done? </p> <p>Below is the code which has been configured in the antixssmodule.config file. This has been added along with the WebControls list.</p> <p>&nbsp;&nbsp;&nbsp; &lt;ControlEncodingContext FullClassName=&quot;Infragistics.WebUI.WebDataInput&quot; PropertyName=&quot;WebTextEdit&quot; EncodingContext=&quot;Html&quot; /&gt;<br> &nbsp;&nbsp;&nbsp; &lt;ControlEncodingContext FullClassName=&quot;Infragistics.WebUI.WebDataInput&quot; PropertyName=&quot;WebNumericEdit&quot; EncodingContext=&quot;Html&quot; /&gt;<br> &nbsp;&nbsp;&nbsp; &lt;ControlEncodingContext FullClassName=&quot;Infragistics.WebUI.WebSchedule&quot; PropertyName=&quot;WebDateChooser&quot; EncodingContext=&quot;Html&quot; /&gt;<br> &nbsp;&nbsp;&nbsp; &lt;ControlEncodingContext FullClassName=&quot;Infragistics.WebUI.WebCombo&quot; PropertyName=&quot;WebCombo&quot; EncodingContext=&quot;Html&quot; /&gt;<br> &nbsp;&nbsp;&nbsp; &lt;ControlEncodingContext FullClassName=&quot;Infragistics.WebUI.UltraWebGrid&quot; PropertyName=&quot;UltraWebGrid&quot; EncodingContext=&quot;Html&quot; /&gt;</p> <p>2) There is another problem on configuring AntiXss module with the application. There are couple of the screens where a default value has been selected in the ListBox control.</p> <p>Now the problem here is... this value is not being selected by default.</p> <p>Using Infragistics 7.1 Vol 1(2007) controls.</p> <p>Visual studio 2005.</p> <p>Thanks,</p> <p>Raghu</p> <p>&nbsp;</p> 2009-11-06T06:27:26-05:002009-11-06T06:27:26.637-05:00urn:uuid:00000000-0000-0000-0000-000003418117http://forums.asp.net/p/1473364/3418117.aspx/1?AntiXSS+module+error+Cannot+get+inner+content+of+because+the+contents+are+not+literal+AntiXSS module error: "Cannot get inner content of because the contents are not literal." &lt;div id=ctl00_ctl00_MasterContent_Content_PostRepeater_ctl00_BodyDiv&gt; <pre><strong>Can someone please explain why this error occurs if one uses the AntiXSS module and how to avoiud it?</strong></pre> <pre><strong></strong></pre> <pre><strong>Thank you very much.</strong></pre> <pre><strong></strong>&nbsp;</pre> <pre><strong></strong>&nbsp;</pre> <pre>&nbsp;</pre> <pre>TargetInvocationException: Exception has been thrown by the target of an invocation. ---&gt;System.Web.HttpException: Cannot get inner content of because the contents are not literal. at System.Web.UI.HtmlControls.HtmlContainerControl.get_InnerHtml() --- End of inner exception stack trace --- at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct&amp; sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture) at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index) at Microsoft.Security.Application.SecurityRuntimeEngine.PageProtection.XssProtection.EncodeControl(Control control, String type) at Microsoft.Security.Application.SecurityRuntimeEngine.PageProtection.XssProtection.FindAndEncodeControls(Page p, ControlCollection cc) at Microsoft.Security.Application.SecurityRuntimeEngine.PageProtection.XssProtection.FindAndEncodeControls(Page p, ControlCollection cc) at Microsoft.Security.Application.SecurityRuntimeEngine.PageProtection.XssProtection.EncodePage(Page p) at Microsoft.Security.Application.SecurityRuntimeEngine.PageProtection.XssProtection.page_PreRender(Object sender, EventArgs e) at System.EventHandler.Invoke(Object sender, EventArgs e) at System.Web.UI.Control.OnPreRender(EventArgs e) at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) </pre> &lt;/div&gt; 2009-09-22T07:13:26-04:002009-09-22T07:13:26.127-04:00urn:uuid:00000000-0000-0000-0000-000003386213http://forums.asp.net/p/1466709/3386213.aspx/1?Encoding+and+XSS+in+generalEncoding and XSS in general <p>1. Can someone explan how encoding helps with XSS? For example, I have a dropdown with 100 values and the user chooses number 50. So are all values encoded then? Can't the attacker do his own encoding and put it back into the dropdown? Please elaborate.</p> <p>2. Can one use this library for non-ASP.NET webform application, can you use it for a custom MVC framework with custom views built on top of ASP.NET? Basically not using asp.net controls</p> 2009-09-03T19:17:20-04:002009-09-03T19:17:20.62-04:00urn:uuid:00000000-0000-0000-0000-000003265992http://forums.asp.net/p/1441494/3265992.aspx/1?How+to+use+JavaSrciptEncode+in+web+pageHow to use JavaSrciptEncode in web page <p>&nbsp;I am trying to use AntiXss methods in my application. Can anybody provide me some example how to use JavascriptEncode method in a page and at which scenarios it should be used.</p> 2009-06-30T08:41:43-04:002009-06-30T08:41:43.42-04:00urn:uuid:00000000-0000-0000-0000-000003239429http://forums.asp.net/p/1436545/3239429.aspx/1?Microsoft+Anti+Cross+Site+library+3+0Microsoft Anti-Cross Site library 3.0 <p>Till date there is a <strong>BETA </strong>version of the Microsoft Anti-Cross Site library 3.0 available. Any idea when Microsoft team is going to release the final version of this library?</p> <p>We&nbsp;were planning to use this in one of our production site.&nbsp;However, since this&nbsp;library is still in BETA stage, product management thinks its a risk.</p> <p>We thought of using the Anti-Cross Site library 1.5, however its license does not allow us to use in the hosted web site. Excerpts from the license of 1.5 are :</p> <p>1. INSTALLATION AND USE RIGHTS.&nbsp; You may install and use any number of copies of the software on your devices to <b>design</b>, <b>develop </b>and <b>test </b>your programs.<br> 2. SCOPE OF LICENSE. .... <b>You may not:</b> .... <b>use the software for commercial software hosting services.</b>... </p> <p>&nbsp;</p> 2009-06-17T10:15:02-04:002009-06-17T10:15:02.33-04:00urn:uuid:00000000-0000-0000-0000-000003133618http://forums.asp.net/p/1418022/3133618.aspx/1?Protection+Required+What+are+1+to+5+steps+Protection Required : What are 1 to 5 steps ??? <p>I undertstand to filter HTML going from editor to SQL server varchar(max) and back to browser is a challenge.</p> <p>I have read about<br> 1) Regex<br> 2) Anti&nbsp;cross scripting&nbsp;library v1.5<br> 3) HTMLencode<br> 4) Page validation = false<br> 5) Common data</p> <p>I have asp.net (VB)&nbsp;2.0 project that allows HTML from an Editor (freetextbox, and obout editor) into SQL server 2005 varchar(max) field, and then its returned back to the browser via user actions.</p> <p>The &#36;64000 dollar questions<br> 1) How to make sure HTML going in from editor&nbsp;is not dangerous<br> 2) How do I make sure that my CSS is not altered<br> 3) How do&nbsp;I stop unwanted scripts (java and vbscripts</p> <p>It seams to me all I want is the same functionality that this forum has posting its posts, or whatever WordPress and other blog systems are using when HTML is posted from editors in there software ?</p> <p>What are steps. Simple please, what functions do I use, any examples in detail in either C# or VB. Why isnt there a one stop package that does it all.</p> <p>I&nbsp;require server side filtering</p> <p>Links read<br> <a href="http://msdn.microsoft.com/en-us/library/aa973813.aspx">http://msdn.microsoft.com/en-us/library/aa973813.aspx</a><br> <a href="http://wiki.flux-cms.org/display/BLOG/XSS&#43;Prevention">http://wiki.flux-cms.org/display/BLOG/XSS&#43;Prevention</a></p> <p><br> <br> &nbsp;</p> <p>&nbsp;</p> 2009-05-01T18:16:23-04:002009-05-01T18:16:23.23-04:00urn:uuid:00000000-0000-0000-0000-000002986098http://forums.asp.net/p/1393578/2986098.aspx/1?Using+AntiXss+with+TagMappingUsing AntiXss with TagMapping <p>Hi,</p> <p>I'm using the AntiXss library in conjunction with TagMapping to remap all textbox and label control data is automatically run through the AntiXss library. When users enter data in a WYSIWYG editor, the data is stored in the database in encoded format in the database.</p> <p>When it's displayed in the browser, all html is displayed, including &lt;p&gt; tags, etc. How can I exclude specific tags from being encoded like that? <br> </p> 2009-03-05T22:46:28-05:002009-03-05T22:46:28.277-05:00urn:uuid:00000000-0000-0000-0000-000002896328http://forums.asp.net/p/1376583/2896328.aspx/1?Using+AntiXss+Using AntiXss? <p>Hello,</p> <p>&nbsp;Could someone please help me to understand if (and how!)&nbsp;I can use AntiXss to filter out Xss in those 2 cases:</p> <p>1. CommandArguement:</p> <p>&lt;asp:LinkButton id=&quot;LinkButton1&quot; CssClass=&quot;Button&quot; runat=&quot;server&quot; CommandArgument='&lt;%# DataBinder.Eval(Container.DataItem,&quot;UserName&quot;) %&gt;'&gt;&lt;%# DataBinder.Eval(Container.DataItem,&quot;UserName&quot;) %&gt;&lt;/asp:LinkButton&gt;</p> <p>What method out of the library can I use to make sure no unwanted code injected into the Command Argument ?</p> <p>2. Image Source</p> <p>&lt;img scr='&lt;% TextBox1.Text %&gt;' /&gt;</p> <p>What method out of the library can help me to make sure no javascript gets into the source of an image?</p> <p>Thank you</p> 2009-01-27T23:01:24-05:002009-01-27T23:01:24.257-05:00urn:uuid:00000000-0000-0000-0000-000002975862http://forums.asp.net/p/1391543/2975862.aspx/1?Microsoft+Security+namespace+does+not+appearMicrosoft.Security namespace does not appear <p><font face="verdana,geneva">Hi,</font></p> <p><font face="verdana,geneva">I want to use Anti-Cross Site Scripting Library V3.0 but I am not able to use it in my application...</font></p> <p><font face="verdana,geneva">I installed AntiXSSV30Beta.msi also...</font></p> <p><font face="verdana,geneva">Do i need to something more with Framework? </font> <br> </p> 2009-03-02T07:17:50-05:002009-03-02T07:17:50.77-05:00urn:uuid:00000000-0000-0000-0000-000002918288http://forums.asp.net/p/1380638/2918288.aspx/1?Problem+with+AttributeEncoding+hrefProblem with AttributeEncoding href <p>Hi, am i missing something but why does the following alert hello when clicking on test:</p> <p>&lt;a href=&quot;&lt;%= Microsoft.Security.Application.AntiXss.HtmlAttributeEncode(&quot;javascript:alert('hello');&quot;) %&gt;&quot;&gt;test&lt;/a&gt;</p> <p>Appreciate your help.&nbsp; Thanks</p> 2009-02-05T11:02:56-05:002009-02-05T11:02:56.313-05:00urn:uuid:00000000-0000-0000-0000-000001994984http://forums.asp.net/p/1179458/1994984.aspx/1?AntiXss+Requiring+Internet+Access+AntiXss Requiring Internet Access? <p>We have a custom class that inherits from AntiXss and anytime a method is called, we have noticed that it is attempting to make a request out to <span style="font-size:10pt; font-family:Arial">131.107.115.28 over port 80.&nbsp; We operate in a highly controlled environment, and most of our servers (web included) only have specific outbound access.</span></p> <p><span style="font-size:10pt; font-family:Arial">&nbsp;Has anyone else noticed this issue?&nbsp; Is there a way to circumvent the outbound call?&nbsp; What exactly is it attempting to do?</span></p> <p><span style="font-size:10pt; font-family:Arial">&nbsp;Thanks in advance,</span></p> <p><span style="font-size:10pt; font-family:Arial">Sam</span></p> 2007-11-07T17:52:29-05:002007-11-07T17:52:29.227-05:00urn:uuid:00000000-0000-0000-0000-000002862228http://forums.asp.net/p/1370300/2862228.aspx/1?Preventing+my+site+from+cross+scriptingPreventing my site from cross scripting <p>&nbsp;Hi,</p> <p>I found that my site which is deployed is vulnerable to XSS scripting.Whenever i try to inject some script from the url through address bar like for example<br> </p> <p><b>http://localhost/mysamplesite/default.mspx/&quot;/alert(1)/&quot;</b></p> <p><b>http://localhost/mysamplesite/default.mspx?fp=&quot;&lt;script&gt;alert(1)&lt;/script&gt;&quot;</b> </p> <p>it is firing an alert.Can anyone plzz guide me how to prevent this,what i need is anything typed in the url if at all a malicious content should just be bypassed.</p> <p>And also plzz let me know more ways how a user can inject script through URL.</p> <p>Thanks.</p> <p>santosh&nbsp;</p> 2009-01-12T13:25:47-05:002009-01-12T13:25:47.207-05:00