Author: eddy556 | Posted on: 3/25/2010 11:58:37 AM | Views : 571

We recently discovered that our web app was vulnerable to cross site scripting (XSS) attacks.  We managed to manipulate our inputs to produce the following HTML:


<a href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$CtlSearchList1$CtlListView1$DataGrid1$ctl03$ctl00','')">'); onclick=alert('This is an XSS vulernability. An attacker could do anything here (redirect to another website, virus etc)');('.txt</a>
Which executes an alert window when clicked.
After HTMLEncoding using the AntiXSS the web app successfully encodes the output to look like this:
<a href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$CtlSearchList1$CtlListView1$DataGrid1$ctl03$ctl00','')">&#39;&#41;&#59; onclick&#61;alert Go to the complete details ...