SunQuest
 
       Windows Security
  Home arrow Windows Security arrow Page 2 - Cross Site Scripting (XSS): An Overview
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Actuate Whitepapers 
VeriSign Whitepapers 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
WINDOWS SECURITY

Cross Site Scripting (XSS): An Overview
By: Lisa Welch
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 8
    2004-07-19

    Table of Contents:
  • Cross Site Scripting (XSS): An Overview
  • The Threats of Cross-site Scripting
  • Possible Solutions
  • Two Cases: True and False
  • Conclusion and Checklist for Data ValidateRequest

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Cross Site Scripting (XSS): An Overview - The Threats of Cross-site Scripting


    (Page 2 of 5 )

    Cross-site scripting poses server application risks that include, but are not limited to, the following:

    • Users can unknowingly execute malicious scripts when viewing dynamically generated pages based on content provided by an attacker.
    • An attacker can take over the user session before the user's session cookie expires.
    • An attacker can connect users to a malicious server of the attacker's choice.
    • An attacker who can convince a user to access a URL supplied by the attacker could cause script or HTML of the attacker's choice to be executed in the user's browser. Using this technique, an attacker can take actions with the privileges of the user who accessed the URL, such as issuing queries on the underlying SQL databases and viewing the results and can exploit the known faulty implementations on the target system.
    • An attacker can easily change the appearance of site when the inputted data is displayed (e.g. simply by introducing a </table> tag)
    • He can display the wrong information through your site to cause even more damage.
    • SQL Injection (Related but different threat.)

    And there are many more ways you can think of.

    If you still think “BUT WHY SHOULD I CARE??”, then read the following to know what can be the consequences. If you don’t care:

    Malicious attacks on Web sites are an industry-wide problem, bringing down Web servers, disrupting online commerce, and threatening users' personal data. The attacker gains the ability to capture the session information, peer into private user details such as ID, passwords, credit card information, home address and telephone number, social security/tax IDs, and so on. If the targeted Web site doesn't check for this type of malicious code, misuse of the user is probable. An attacker can capture the user's session and steal the user's credentials, redirect to a page on another Web site, and then insert code that can poison cookies, expose SSL connections, access restricted or private sites, or even trigger a number of such attacks.

    Everything from account hijacking, changing of user settings, cookie theft/poisoning, or false advertising is possible. New malicious uses are being found every day for XSS attacks.

    An Example:

    Suppose we have an ASP page called hello.asp that displays everything posted to it on As Input as Output basis.

    <%Response.Write (“hello ”+Request.QueryString) %>

    Contents of file hello.asp

    If we use following as input:

    /hello.asp?Jack

    This would print ”hello Jack” on the page.

    Now comes some crook minded that input the following:

    /hello.asp?<B>Fool</B><script>window.close()</script>

    This would print “hello Fool” and then tries to close the window.

    Still no problem if this page is used only for that crook. But if we use this kind of code on a message board, this would certainly cause a problem for each user visiting the board.

    This would be fatal if he tries to enter something like this:

    /hello.asp?<script>window.location=”Some fatal Location;”</script>

    This would redirect the browser to location specified in string. That can be even the link to some executable like www.foo.com/virus.exe and a user who is surfing your site and does trust it, he may even download the file and then BANG.

    Now you can think of what can be done using XSS.

    I had written one of the most basic and non fatal example because I don’t want you to use this article for learning how to cause XSS attacks.

    This can also be done if user submitted information even using post is displayed back on your page without any validation.

    More Windows Security Articles
    More By Lisa Welch


     

    WINDOWS SECURITY ARTICLES

    - Advanced Data Protection in Windows
    - Basic Data Protection in Windows
    - Windows XP Security
    - Lucky You, Microsoft has Sent You an Email! ...
    - Implementing a PKI, Part III: Managing Micro...
    - Windows 2000 Security
    - A Security Roadmap
    - Implementing a Public Key Infrastructure (PK...
    - Hardening Communications
    - Windows Host Security: Network Security Hacks
    - Hardening Wireless LAN Connections, Part 2
    - Hardening Wireless LAN Connections Part 1
    - Windows Reverse Engineering
    - Microsoft's Latest Security Updates -- The G...
    - Cross Site Scripting (XSS): An Overview





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway