XSS (Cross-site Scripting) allows an attacker to execute a dynamic script (Javascript, VbScript) in the context of the application. This allows several different attack opportunities, mostly hijacking the current session of the user or changing the look of the page by changing the HTML on the fly to steal the user's credentials. This happens because the input entered by a user has been interpreted as HTML/Javascript/VbScript by the browser.
XSS targets the users of the application instead of the server. Although this is a limitation, since it allows attackers to hijack other users' session, an attacker might attack an administrator to gain full control over the application.
Impact
There are many different attacks that can be leveraged through the use of XSS, including:
Hi-jacking users' active session
Changing the look of the page within the victims browser.
Mounting a successful phishing attack.
Intercept data and perform man-in-the-middle attacks.
Remedy
The issue occurs because the browser interprets the input as active HTML, Javascript or VbScript. To avoid this, all input and output from the application should be filtered. Output should be filtered according to the output format and location. Typically the output location is HTML. Where the output is HTML ensure that all active content is removed prior to its presentation to the server.
Prior to sanitizing user input, ensure you have a pre-defined list of both expected and acceptable characters with which you populate a white-list. This list needs only be defined once and should be used to sanitize and validate all subsequent input.
There are a number of pre-defined, well structured white-list libraries available for many different environments, good examples of these include, OWASP Reform and Microsoft Anti Cross-site Scripting libraries are good examples.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Bing "Likes" Facebook - Discover Bing</title>
<meta name="keywords" content="bing, facebook, social, search, share" /> <meta name="description" content="Find out how Bing can help you find information you need and then share it with whom you want!" /> <!--to set the facebook opengraph/sharer thumb--> <meta property="og:image" content="http://az10143.vo.msecnd.net/sitecore/dbing/media/Images/bing_logo_fb.png?x=8" /> <meta name="HandheldFriendly" content="true" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta name="CODE_LANGUAGE" content="C#" /> <meta name="vs_defaultClientScript" content="JavaScript" /> <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5" /> <link rel="shortcut icon" href="https://cdndiscoverbing.blob.core.windows.net/sitecore/favicon.ico" /> <link rel="icon" href="https://cdndiscoverbing.blob.core.windows.net/sitecore/favicon.ico" />
<!--[if lte IE 6]> <script type="text/javascript" src="http://az10143.vo.msecnd.net/sitecore/dbing/Scripts/ie6.js"></script> <![endif]--> <!--to set the facebook opengraph/sharer thumb - it appears that it's necessary that these live below the meta description in order for FB to pull the correct description -->
<li><a href="/Activities/MakeLocalPlans" >Make Local Plans<small>Plan a night out.</small></a></li>
<li><a href="/Activities/BePrepared" >Start Your Day<small>Be prepared.</small></a></li>
<li><a href="/Activities/BeHealthy" >Be Healthy<small>Know more. Feel better.</small></a></li>
<li><a href="/Activities/FindFlights" >Plan a Beach Holiday<small>Find flight deals.</small></a></li>
<li><a href="/Activities/SocialSearch" class = active>Bing "Likes" Facebook<small>Social Search</small></a></li>
</ul>
</div> <div class="right">
<script language="javascript" type='text/javascript' src="http://az10143.vo.msecnd.net/sitecore/dbing/videoPlayer/silverlight.js"></script> <script language="javascript" type='text/javascript' src="http://az10143.vo.msecnd.net/sitecore/dbing/videoPlayer/wmvplayer.js"></script> <script language="javascript" type="text/javascript" src="http://az10143.vo.msecnd.net/sitecore/dbing/videoPlayer/tools.js"></script> <script language="javascript" type="text/javascript" src="http://az10143.vo.msecnd.net/sitecore/dbing/videoPlayer/xaml.js"></script> <script language="javascript" type="text/javascript" src="http://az10143.vo.msecnd.net/sitecore/dbing/videoPlayer/jwplayer.js"></script> <script language="javascript" type="text/javascript" src="http://az10143.vo.msecnd.net/sitecore/dbing/videoPlayer/flashver.js"></script> <div class="feature"> <div class="intro"> <h3> Bing "likes" Facebook</h3> <p> Bing has connected with Facebook to make searching on Bing more social. Together, Bing and Facebook offer you better search results—and a more personalized experience with a little help from your Facebook friends. Your friends introduce you to new music, restaurants, movies and more. Now Bing helps you discover what they have "liked" and shared on the web. </p> <p><span style="margin-right: 30px;"><a href="http://www.bing.com/social/?FORM=MFEHPG&PUBL=DBING&CREA=SC_MFEHPG__15620110215-1_SearchMoreSocial_1x1" class="cta" target="_blank" onclick="trackitAuto('event54', 'e', 'UserEd:en-US:Dbing:/Home/Activities/SocialSearch/Feature:Feature', 'Activities', 'SocialSearch', 'Feature', 'Feature');">Bring your friends: Search more social</a></span>
<div class="white-box"> <img alt="" class="greyborder" src="http://az10143.vo.msecnd.net/sitecore/dbing/media/Images/socialsearch/module1.jpg" /> <h3>Facebook profile search</h3><p>Find old friends or discover new ones through Facebook Profile Search on Bing. When you search for people ..
Netsparker identified that the target web server is disclosing ASP.NET version in the HTTP response. This information can help an attacker to develop further attacks and also the system can become an easier target for automated attacks. It was leaked from X-AspNet-Version banner of HTTP response or default ASP.NET error page.
Impact
An attacker can use disclosed information to harvest specific security vulnerabilities for the version identified. The attacker can also use this information in conjunction with the other vulnerabilities in the application or web server.
Remedy
Apply the following changes on your web.config file to prevent information leakage by using custom error pages and removing X-AspNet-Version from HTTP responses.
Netsparker identified that the target web server is disclosing the web server's version in the HTTP response. This information can help an attacker to gain a greater understanding of the system in use and potentially develop further attacks targeted at the specific web server version.
Impact
An attacker can look for specific security vulnerabilities for the version identified through the SERVER header information.
Remediation
Configure your web server to prevent information leakage from the SERVER header of its HTTP response.