Statistics

Total Posts: 34
This Year: 0
This Month: 0
This Week: 0
Comments: 174


RSS 2.0   SocialTwist Tell-a-Friend


Admin

Sign In

Navigation


Recent Posts


On this page....

How to check a web form can have HTML/Script Injection?

Archives

 Full Archives By Category
 2007 Calendar View
<January 2009>
SunMonTueWedThuFriSat
28293031123
45678910
11121314151617
18192021222324
25262728293031
1234567

Categories

CDOSYS (1) Classic ASP (10) Command Line (2) Databases (16) Excel (1) HTML (1) IIS (10) Indexing Service (1) Internet Explorer (7) Media Streaming (1) MS.Net (2) SQA (7) SQL Server (16) Windows OS (2)

Blogroll - Fav Blogs


Acknowledgments

DasBlog Theme Design by: Tom Watts
E-mail: Send mail to the author(s)
Theme Image by: dreamLogic

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

Technology Blog

Injection of HTML code and/or client side scripts like JavaScript, VBScript, and Jscript by malicious web users into the web pages viewed by other users is a computer security vulnerability typically found in web applications. This is popularly known as Cross Site Scripting (XSS) Attack.

Injection of the code can be done either from a web form or through a query string input. To check whether your web application is open to XSS, insert the following code given below in the Input Textbox and/or TextArea of the web form (In case of Query String, replace the value with the code given below).

<Script> alert(‘XSS attack is possible’); </script>

Submit the web form or the page. Check the display or view page of the application. If you get an alert message “XSS attack is possible”, then your application is unsafe and is open for XSS attack.

Now, you would have the question in your mind as how do I avoid XSS attack on the web application? Well you can apply the following checklist in your web application code:
  • Apply HTMLEncode in the action page/code in all web forms
  • Apply URLEncode in the action page/code in your web application
  • User proper validations for numeric, date and length of the data
  • Always validate data against data type
  • Avoid special characters like *, %, @, !