ArticleTrader.com
  

 Main Menu

  Home
  Member Login
  Forum
  Submit Article
  Membership
  RSS Feeds
  Contact Us
  About

 Services

  Article Distribution
  Link Building

 Tools

  ArticleMS
  Directory Tracker

 Categories

  Automotive
  Business
  Computers
  » Games
  » Hardware
  » Software
  Entertainment
  Finance
  Food
  Health
  Home and Family
  Internet
  Legal
  Science
  Self Improvement
  Shopping
  Society
  Sports
  Technology
  Travel
  Writing

187 users online.



 
  » Category Sponsors
  Get Your Link Here - Limited Time Bargain at only $11/month!

Home » Computers » Software » What are cross site scripting attacks?

Spec-India
Article written by Spec-India

View Full Profile
Get Html Code
PDF | Print View | Post to your Site

What are cross site scripting attacks?

Submitted by Spec-India
Sat, 25 Jun 2011

Cross-site scripting (XSS) bugs are a form of security defect unique to web-based applications that allow user data tied to the vulnerable web server's domain, usually held in cookies, to be disclosed to a malicious third party. Hence the term "cross-site": the cookie is transferred from a client computer accessing a valid, but vulnerable, web-server site to a site of the attacker's bidding. At least, this is the most common type of attack using XSS.

Any language or technology used to build a web site; for example PHP, Active Server Pages (ASP), C#, VB.Net, ASP.NET, J2EE (JSP, Servlets), Perl, and Common Gateway Interface (CGI) can be affected by this attack.

The sin is straightforward: a web application takes some input from a user, perhaps from a query string, fails to validate the input, and echoes that input directly in a web page. It's really that simple! Because the web server is echoing input, the input might be a script language, such as JavaScript, and this is echoed and interpreted in the destination browser.

As you can see, this is a classic input trust issue. The web application is expecting some text, a name for example, in a querystring, but the bad guy provides something the web application developer never expected.

An XSS attack works this way:

1. The attacker identifies a web site that has one or more XSS bugs—for example, a web site that echoes the contents of a query string.
2. The attacker crafts a special URL that includes a malformed and malicious query string containing HTML and script, such as JavaScript.
3. The attacker finds a victim, and gets the victim to click a link that includes the malformed query string. This could be simply a link on another web page, or a link in an HTML e-mail.
4. The victim clicks the links and the victim's browser makes a GET request to the vulnerable server, passing the malicious querystring.
5. The vulnerable server echoes the malicious querystring back to the victim's browser, and the browser executes the JavaScript embedded in the response.

Because the code is running in the context of the vulnerable web server, it can access the victim's cookie tied to the vulnerable server's domain. The code can also access the Document Object Model (DOM) and modify any element within it; for example, the exploit code could tweak all the links to point to porn sites. Now when the victim clicks on any link, he is whisked off to some location in cyberspace he wished he hadn't gone to.
The output does not need to be visible to lead to an XSS bug; any kind of echo will suffice. For example, the web server might echo the input as an argument in a valid JavaScript block in the web page, or perhaps the data is the name of an image file in an IMG tag.

Be wary of blog or product review/feedback web applications because this type of application must read arbitrary HTML input from a user (or attacker) and then echo said text for all to read. In an insecure application, this leads to XSS attacks.

 

Spec India is a Custom Software Application Development and Software Solutions Company based in Ahmedabad, India. Our Services includes iPhone Application Development, Android Application Development, ORACLE, .Net, and Mobile Computing.


Source: ArticleTrader.com
Creative Commons License

Comments

No comments posted.

Add Comment

You do not have permission to comment. If you log in, you may be able to comment.

 Top Authors

 1 Stebee (3270)
 2 limalan88 (2920)
 3 alien82 (2756)
 4 kajuba (2508)
 5 sverdlow (1712)
 6 jamiehanson (1705)
 7 juliet (1691)
 8 MarkeD (1296)
 9 robertoms2003 (1296)
 10 AnthonyF (1244)
 11 articles (1205)
 12 artavia.seo (1148)
 13 spinxwebdesign (1119)
 14 gprather (1071)
 15 LouieLiu (1069)

 Distribution

Article Distribution

  
  Affiliate Program 2Checkout.com, Inc. is an authorized retailer of ArticleTrader.com

0.02s