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.
HTTP/1.1 200 OK Cache-Control: private, no-store Content-Length: 12957 Content-Type: text/html; charset=utf-8 p3p: CP=ALL DSP COR CURa TAIi PSAa OUR BUS PHY ONL UNI FIN COM NAV DEM HEA PRE OTC Set-Cookie: SessionTokenIdentifier=0235682886; path=/ Date: Tue, 03 May 2011 01:16:50 GMT
<html xmlns="http://www.w3.org/1999/xhtml" > <head id="ctl00_Head1"><meta http-equiv="Pragma" content="no-cache" /><meta http-equiv="Expires" content="-1" /><meta http-equiv="CACHE-CONTROL" content="NO-CACHE" /><title> Nationwide Building Society - Internet Banking </title>
<script language="javascript" type="text/javascript"> function ShowHelp() { // will always open in centre of screen, regardless of screen resolution var popUpWidth = 640; var popUpHeight = 480; var x = ((screen.width - popUpWidth)/2); var y = ((screen.height - popUpHeight)/2); window.status='Sign On';
<div id="header-nav"> <p id="header-blurb">Welcome to Nationwide's Internet Banking</p> <ul id="header-nav-secondary"> <li><a href="javascript:ShowDemo();" onmouseover="window.status='Demonstration of this site';return true;" onmouseout="window.status='';return true;" title="Demonstration of this site"><b>Demo</b></a></li> <li><a href="javascript:ShowHelp();" onmouseover="window.status='View help topics for this page';return true;" onmouseout="window.status='';return true;" title="View help topics for this page"><b>Help</b></a></li> </ul> </div> </div> <div id="main-content" style="position:absolute; top:115px;" >
<script type="text/javascript"> function msg1() {window.status="Please enter your 10-digit Customer Number"}
function PageLoadEvents() { document.aspnetForm.ctl00_cphMainContent_txtScreenResolution.value = screen.width + " x " + screen.height; document.aspnetForm.ctl00_cphMainContent_txtPersistentCookies.value = persistentCookiesEnabled(); var visitortime = new Date(); var timeZone = "" if (visitortime) { document.aspnetForm.ctl00_cphMainContent_txtTimeZone.value = (-(visitortime.getTimezoneOffset()/60)); } document.aspnetForm.ctl00_cphMainContent_txtReferringUri.value = document.referrer; document.aspnetForm.txt0235682886.focus();
checkforcookie();
}
function persistentCookiesEnabled() { var cookieName = "OlbTempTestCookie"; var expireDate = new Date(); expireDate.setDate(expireDate.getDate() + 2); document.cookie = cookieName + "=" + cookieName +"; path=/; expires=" + expireDate.toGMTString(); var start = document.cookie.indexOf(cookieName + "=" + cookieName); if (document.cookie.indexOf(cookieName + "=" + cookieName) > -1) { document.cookie = cookieName + "=; path=/; expires=Thu, 01-Jan-1970 00:00:01 GMT"; return true; } return false; }
function getCookie(sCookieName) { var aCookie = document.cookie.split("; ");
for (var i=0; i < aCookie.length; i++) { var thisCookie = aCookie[i].split("=");
if (sCookieName == thisCookie[0]) return unescape(thisCookie[1]); }
<div class="question-set"> <label for="chkboxRememberName" class="checkbox"><input id="ctl00_cphMainContent_chkboxRememberNum" type="checkbox" name="ctl00$cphMainContent$chkboxRememberNum" onclick="javascript:setTimeout('__doPostBack(\'ctl00$cphMainContent$chkboxRememberNum\',\'\')', 0)" tabindex="3" /> Remember my customer number*</label> <p>*Only select this if this is your computer and it is not used by anyone else</p>
</div>
</div> </div> <p class="warning">For security reasons, when you have finished using Internet Banking always select SIGN OFF.</p> </div> <div id="sign-on-my-save"> <h2>Sign on to MySave</h2> <div id="my-save-info"> <img src="/images/my-save.gif" alt="MySave Online Savings - Manage your MySave account online" /> <a id="ctl00_cphMainContent_linkWhatsThis" href="http://www.nationwide.co.uk/savings/aboutmysave.htm" target="_blank">What is MySave?</a> </div> <div id="my-save-sign-on"> <p>Sign on to your MySave account</p> <input type="submit" name="ctl00$cphMainContent$btnMySave" value="Go to MySave >>" id="ctl00_cphMainContent_btnMySave" tabindex="3" class="button" /> </div> </div> </div>
HTTP/1.1 200 OK Cache-Control: private, no-store Content-Length: 12957 Content-Type: text/html; charset=utf-8 p3p: CP=ALL DSP COR CURa TAIi PSAa OUR BUS PHY ONL UNI FIN COM NAV DEM HEA PRE OTC Set-Cookie: SessionTokenIdentifier=7863457345; path=/ Date: Tue, 03 May 2011 01:16:56 GMT
<html xmlns="http://www.w3.org/1999/xhtml" > <head id="ctl00_Head1"><meta http-equiv="Pragma" content="no-cache" /><meta http-equiv="Expires" content="-1" /><meta http-equiv="CACHE-CONTROL" content="NO-CACHE" /><title> Nationwide Building Society - Internet Banking </title>
<script language="javascript" type="text/javascript"> function ShowHelp() { // will always open in centre of screen, regardless of screen resolution var popUpWidth = 640; var popUpHeight = 480; var x = ((screen.width - popUpWidth)/2); var y = ((screen.height - popUpHeight)/2); window.status='Sign On';
<div id="header-nav"> <p id="header-blurb">Welcome to Nationwide's Internet Banking</p> <ul id="header-nav-secondary"> <li><a href="javascript:ShowDemo();" onmouseover="window.status='Demonstration of this site';return true;" onmouseout="window.status='';return true;" title="Demonstration of this site"><b>Demo</b></a></li> <li><a href="javascript:ShowHelp();" onmouseover="window.status='View help topics for this page';return true;" onmouseout="window.status='';return true;" title="View help topics for this page"><b>Help</b></a></li> </ul> </div> </div> <div id="main-content" style="position:absolute; top:115px;" >
<script type="text/javascript"> function msg1() {window.status="Please enter your 10-digit Customer Number"}
function PageLoadEvents() { document.aspnetForm.ctl00_cphMainContent_txtScreenResolution.value = screen.width + " x " + screen.height; document.aspnetForm.ctl00_cphMainContent_txtPersistentCookies.value = persistentCookiesEnabled(); var visitortime = new Date(); var timeZone = "" if (visitortime) { document.aspnetForm.ctl00_cphMainContent_txtTimeZone.value = (-(visitortime.getTimezoneOffset()/60)); } document.aspnetForm.ctl00_cphMainContent_txtReferringUri.value = document.referrer; document.aspnetForm.txt7863457345.focus();
checkforcookie();
}
function persistentCookiesEnabled() { var cookieName = "OlbTempTestCookie"; var expireDate = new Date(); expireDate.setDate(expireDate.getDate() + 2); document.cookie = cookieName + "=" + cookieName +"; path=/; expires=" + expireDate.toGMTString(); var start = document.cookie.indexOf(cookieName + "=" + cookieName); if (document.cookie.indexOf(cookieName + "=" + cookieName) > -1) { document.cookie = cookieName + "=; path=/; expires=Thu, 01-Jan-1970 00:00:01 GMT"; return true; } return false; }
function getCookie(sCookieName) { var aCookie = document.cookie.split("; ");
for (var i=0; i < aCookie.length; i++) { var thisCookie = aCookie[i].split("=");
if (sCookieName == thisCookie[0]) return unescape(thisCookie[1]); }
<div class="question-set"> <label for="chkboxRememberName" class="checkbox"><input id="ctl00_cphMainContent_chkboxRememberNum" type="checkbox" name="ctl00$cphMainContent$chkboxRememberNum" onclick="javascript:setTimeout('__doPostBack(\'ctl00$cphMainContent$chkboxRememberNum\',\'\')', 0)" tabindex="3" /> Remember my customer number*</label> <p>*Only select this if this is your computer and it is not used by anyone else</p>
</div>
</div> </div> <p class="warning">For security reasons, when you have finished using Internet Banking always select SIGN OFF.</p> </div> <div id="sign-on-my-save"> <h2>Sign on to MySave</h2> <div id="my-save-info"> <img src="/images/my-save.gif" alt="MySave Online Savings - Manage your MySave account online" /> <a id="ctl00_cphMainContent_linkWhatsThis" href="http://www.nationwide.co.uk/savings/aboutmysave.htm" target="_blank">What is MySave?</a> </div> <div id="my-save-sign-on"> <p>Sign on to your MySave account</p> <input type="submit" name="ctl00$cphMainContent$btnMySave" value="Go to MySave >>" id="ctl00_cphMainContent_btnMySave" tabindex="3" class="button" /> </div> </div> </div>
HTTP/1.1 200 OK Cache-Control: no-cache Pragma: no-cache Content-Length: 2197 Content-Type: text/html; charset=utf-8 Expires: -1 p3p: CP=ALL DSP COR CURa TAIi PSAa OUR BUS PHY ONL UNI FIN COM NAV DEM HEA PRE OTC Date: Tue, 03 May 2011 01:11:34 GMT
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE>Error Page</TITLE> <LINK REL='stylesheet' TYPE='text/css' href='../StyleSheets/ApplyOnLineBaseTemplate.css'> </HEAD> <BODY BGCOLOR="white"> <form> <TABLE CELLSPACING="0" CELLPADDING="0" BORDER="0" ALIGN="center" width="80%"> <TR> <TD> <TABLE CELLSPACING="0" CELLPADDING="0" BORDER="1" WIDTH="100%" BORDERCOLOR="#cccccc"> <TR> <TD COLSPAN="2"> <TABLE CELLSPACING="5" CELLPADDING="3" BORDER="0" WIDTH="100%"> <TR> <TD class="formname">ERROR</TD> <TD class="pagedescription"></TD> </TR> </TABLE> </TD> </TR> <TR VALIGN="top"> <TD height="111"> <TABLE WIDTH="100%" CELLPADDING="0" CELLSPACING="2"> <TR VALIGN="top"> <TD> <TABLE WIDTH="100%" cellpadding="5" cellspacing="3"> <TR> <TD COLSPAN="2" class="forminformation" height="49"> <span id="ErrorTextHtml">An error occurred performing your request.<BR>A problem has occurred trying to process your request. Please try again later. If this problem persists please contact Nationwide Customer Services on 08457 30 20 10.</span> </TD> </TR> </TABLE> </TD> </TR> </TABLE> </TD> </TR> </TABLE> <TABLE CELLSPACING="0" CELLPADDING="0" BORDER="0" ALIGN="right" WIDTH="100%"> <TR> <TD ALIGN="left" height="2"> </TD> <TD ALIGN="right" height="30" valign="bottom">
A Cookie was not marked as secure and transmitted over HTTPS. This means the cookie could potentially be stolen by an attacker who can successfully intercept and decrypt the traffic or following a successful MITM (Man in the middle) attack.
Impact
This cookie will be transmitted over a HTTP connection, therefore if this cookie is important (such as a session cookie) an attacker might intercept it and hijack a victim's session. If the attacker can carry out a MITM attack, he/she can force victim to make a HTTP request to steal the cookie.
Actions to Take
See the remedy for solution.
Mark all cookies used within the application as secure. (If the cookie is not related to authentication or does not carry any personal information you do not have to mark it as secure.))
Remedy
Mark all cookies used within the application as secure.
Required Skills for Successful Exploitation
To exploit this issue, the attacker needs to be able to intercept traffic. This generally requires local access to the web server or victim's network. Attackers need to be understand layer 2, have physical access to systems either as way points for the traffic, or locally (have gained access to) to a system between the victim and the web server.
GET /MyApplications/ HTTP/1.1 Referer: https://olb2.nationet.com/MyApplications/UnregisteredApplication.aspx?ID=3e16672fbeb645421c949ea4d5f68261e40&apptype=FLEXACCOUNT User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322) Cache-Control: no-cache Host: olb2.nationet.com Cookie: ASPSESSIONIDCAATARTS=BLMLIEGDLGCKJBEIBMLCBLMK; SessionTokenIdentifier=0396747136; CookieValidator=0; ASPSESSIONIDCAARCRRS=POGEJLADGAFGDEILEDCHKKNK Accept-Encoding: gzip, deflate
Response
HTTP/1.1 302 Object moved Cache-Control: private Content-Length: 133 Content-Type: text/html Expires: -1 Location: /default.asp p3p: CP=ALL DSP COR CURa TAIi PSAa OUR BUS PHY ONL UNI FIN COM NAV DEM HEA PRE OTC Set-Cookie: ASPSESSIONIDCSCRAQTQ=DNPLCBKDLGAPIIGIGMFOBOCL; path=/ Date: Tue, 03 May 2011 01:10:27 GMT
<head><title>Object moved</title></head><body><h1>Object Moved</h1>This object may be found <a HREF="/default.asp">here</a>.</body>
The Server responded with an HTTP status 500. This indicates that there is a server-side error. Reasons may vary. The behavior should be analysed carefully. If Netsparker is able to find a security issue in the same resource it will report this as a separate vulnerability.
Impact
The impact may vary depending on the condition. Generally this indicates poor coding practices, not enough error checking, sanitization and whitelisting. However there might be a bigger issue such as SQL Injection. If that's the case Netsparker will check for other possible issues and report them separately.
Remedy
Analyse this issue and review the application code in order to handle unexpected errors, this should be a generic practice which does not disclose further information upon an error. All errors should be handled server side only.
HTTP/1.1 500 Internal Server Error Cache-Control: private Content-Length: 6901 Content-Type: text/html; charset=utf-8 p3p: CP=ALL DSP COR CURa TAIi PSAa OUR BUS PHY ONL UNI FIN COM NAV DEM HEA PRE OTC Date: Tue, 03 May 2011 01:11:32 GMT
<html> <head> <title>A potentially dangerous Request.QueryString value was detected from the client (ID="'"--></style></script><sc...").</title> <style> body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } pre {font-family:"Lucida Console";font-size: .9em} .marker {font-weight: bold; color: black;text-decoration: none;} .version {color: gray;} .error {margin-bottom: 10px;} .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; } </style> </head>
<body bgcolor="white">
<span><H1>Server Error in '/Discovery' Application.<hr width=100% size=1 color=silver></H1>
<h2> <i>A potentially dangerous Request.QueryString value was detected from the client (ID="'"--></style></script><sc...").</i> </h2></span>
<b> Description: </b>Request Validation has detected a potentially dangerous client input value, and processing of the request has been aborted. This value may indicate an attempt to compromise the security of your application, such as a cross-site scripting attack. You can disable request validation by setting validateRequest=false in the Page directive or in the <pages> configuration section. However, it is strongly recommended that your application explicitly check all inputs in this case. <br><br>
<b> Exception Details: </b>System.Web.HttpRequestValidationException: A potentially dangerous Request.QueryString value was detected from the client (ID="'"--></style></script><sc...").<br><br>
The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:<br><br>1. Add a "Debug=true" directive at the top of the file that generated the error. Example:<br><br> <%@ Page Language="C#" Debug="true" %><br><br>or:<br><br>2) Add the following section to the configuration file of your application:<br><br><configuration><br> <system.web><br> <compilation debug="true"/><br> </system.web><br></configuration><br><br> Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.<br><br>Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.</code>
<b>Version Information:</b> Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832
</font>
</body> </html> <!-- [HttpRequestValidationException]: A potentially dangerous Request.QueryString value was detected from the client (ID="'"--></style></script><sc..."). at System.Web.HttpRequest.ValidateString(String s, String valueName, String collectionName) at System.Web.HttpRequest.ValidateNameValueCollection(NameValueCollection nvc, String collectionName) at System.Web.HttpRequest.get_QueryString() at System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull) at System.Web.UI.Page.DeterminePostBackMode() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.fullflex_applicationremote_aspx.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) --><!-- This error page might contain sensitive information because ASP.NET is configured to show verbose error messages using <customErrors mode="Off"/>. Consider using <customErrors mode="On"/> or <customErrors mode="RemoteOnly"/> in production environments.-->
Cookie was not marked as HTTPOnly. HTTPOnly cookies can not be read by client-side scripts therefore marking a cookie as HTTPOnly can provide an additional layer of protection against Cross-site Scripting attacks..
Impact
During a Cross-site Scripting attack an attacker might easily access cookies and hijack the victim's session.
Actions to Take
See the remedy for solution
Consider marking all of the cookies used by the application as HTTPOnly (After these changes javascript code will not able to read cookies.
Remedy
Mark the cookie as HTTPOnly. This will be an extra layer of defence against XSS. However this is not a silver bullet and will not protect the system against Cross-site Scripting attacks. An attacker can use a tool such as XSS Tunnel to bypass HTTPOnly protection.
GET /MyApplications/ HTTP/1.1 Referer: https://olb2.nationet.com/MyApplications/UnregisteredApplication.aspx?ID=3e16672fbeb645421c949ea4d5f68261e40&apptype=FLEXACCOUNT User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322) Cache-Control: no-cache Host: olb2.nationet.com Cookie: ASPSESSIONIDCAATARTS=BLMLIEGDLGCKJBEIBMLCBLMK; SessionTokenIdentifier=0396747136; CookieValidator=0; ASPSESSIONIDCAARCRRS=POGEJLADGAFGDEILEDCHKKNK Accept-Encoding: gzip, deflate
Response
HTTP/1.1 302 Object moved Cache-Control: private Content-Length: 133 Content-Type: text/html Expires: -1 Location: /default.asp p3p: CP=ALL DSP COR CURa TAIi PSAa OUR BUS PHY ONL UNI FIN COM NAV DEM HEA PRE OTC Set-Cookie: ASPSESSIONIDCSCRAQTQ=DNPLCBKDLGAPIIGIGMFOBOCL; path=/ Date: Tue, 03 May 2011 01:10:27 GMT
<head><title>Object moved</title></head><body><h1>Object Moved</h1>This object may be found <a HREF="/default.asp">here</a>.</body>
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.
HTTP/1.1 500 Internal Server Error Cache-Control: private Content-Length: 6901 Content-Type: text/html; charset=utf-8 p3p: CP=ALL DSP COR CURa TAIi PSAa OUR BUS PHY ONL UNI FIN COM NAV DEM HEA PRE OTC Date: Tue, 03 May 2011 01:11:32 GMT
<html> <head> <title>A potentially dangerous Request.QueryString value was detected from the client (ID="'"--></style></script><sc...").</title> <style> body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } pre {font-family:"Lucida Console";font-size: .9em} .marker {font-weight: bold; color: black;text-decoration: none;} .version {color: gray;} .error {margin-bottom: 10px;} .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; } </style> </head>
<body bgcolor="white">
<span><H1>Server Error in '/Discovery' Application.<hr width=100% size=1 color=silver></H1>
<h2> <i>A potentially dangerous Request.QueryString value was detected from the client (ID="'"--></style></script><sc...").</i> </h2></span>
<b> Description: </b>Request Validation has detected a potentially dangerous client input value, and processing of the request has been aborted. This value may indicate an attempt to compromise the security of your application, such as a cross-site scripting attack. You can disable request validation by setting validateRequest=false in the Page directive or in the <pages> configuration section. However, it is strongly recommended that your application explicitly check all inputs in this case. <br><br>
<b> Exception Details: </b>System.Web.HttpRequestValidationException: A potentially dangerous Request.QueryString value was detected from the client (ID="'"--></style></script><sc...").<br><br>
The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:<br><br>1. Add a "Debug=true" directive at the top of the file that generated the error. Example:<br><br> <%@ Page Language="C#" Debug="true" %><br><br>or:<br><br>2) Add the following section to the configuration file of your application:<br><br><configuration><br> <system.web><br> <compilation debug="true"/><br> </system.web><br></configuration><br><br> Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.<br><br>Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.</code>
<b>Version Information:</b> Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832
</font>
</body> </html> <!-- [HttpRequestValidationException]: A potentially dangerous Request.QueryString value was detected from the client (ID="'"--></style></script><sc..."). at System.Web.HttpRequest.ValidateString(String s, String valueName, String collectionName) at System.Web.HttpRequest.ValidateNameValueCollection(NameValueCollection nvc, String collectionName) at System.Web.HttpRequest.get_QueryString() at System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull) at System.Web.UI.Page.DeterminePostBackMode() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.fullflex_applicationremote_aspx.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) --><!-- This error page might contain sensitive information because ASP.NET is configured to show verbose error messages using <customErrors mode="Off"/>. Consider using <customErrors mode="On"/> or <customErrors mode="RemoteOnly"/> in production environments.-->
HTTP/1.1 500 Internal Server Error Cache-Control: private Content-Length: 6901 Content-Type: text/html; charset=utf-8 p3p: CP=ALL DSP COR CURa TAIi PSAa OUR BUS PHY ONL UNI FIN COM NAV DEM HEA PRE OTC Date: Tue, 03 May 2011 01:11:32 GMT
<html> <head> <title>A potentially dangerous Request.QueryString value was detected from the client (ID="'"--></style></script><sc...").</title> <style> body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } pre {font-family:"Lucida Console";font-size: .9em} .marker {font-weight: bold; color: black;text-decoration: none;} .version {color: gray;} .error {margin-bottom: 10px;} .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; } </style> </head>
<body bgcolor="white">
<span><H1>Server Error in '/Discovery' Application.<hr width=100% size=1 color=silver></H1>
<h2> <i>A potentially dangerous Request.QueryString value was detected from the client (ID="'"--></style></script><sc...").</i> </h2></span>
<b> Description: </b>Request Validation has detected a potentially dangerous client input value, and processing of the request has been aborted. This value may indicate an attempt to compromise the security of your application, such as a cross-site scripting attack. You can disable request validation by setting validateRequest=false in the Page directive or in the <pages> configuration section. However, it is strongly recommended that your application explicitly check all inputs in this case. <br><br>
<b> Exception Details: </b>System.Web.HttpRequestValidationException: A potentially dangerous Request.QueryString value was detected from the client (ID="'"--></style></script><sc...").<br><br>
The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:<br><br>1. Add a "Debug=true" directive at the top of the file that generated the error. Example:<br><br> <%@ Page Language="C#" Debug="true" %><br><br>or:<br><br>2) Add the following section to the configuration file of your application:<br><br><configuration><br> <system.web><br> <compilation debug="true"/><br> </system.web><br></configuration><br><br> Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.<br><br>Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.</code>
<b>Version Information:</b> Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832
</font>
</body> </html> <!-- [HttpRequestValidationException]: A potentially dangerous Request.QueryString value was detected from the client (ID="'"--></style></script><sc..."). at System.Web.HttpRequest.ValidateString(String s, String valueName, String collectionName) at System.Web.HttpRequest.ValidateNameValueCollection(NameValueCollection nvc, String collectionName) at System.Web.HttpRequest.get_QueryString() at System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull) at System.Web.UI.Page.DeterminePostBackMode() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.fullflex_applicationremote_aspx.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) --><!-- This error page might contain sensitive information because ASP.NET is configured to show verbose error messages using <customErrors mode="Off"/>. Consider using <customErrors mode="On"/> or <customErrors mode="RemoteOnly"/> in production environments.-->
Netsparker identified that the target web application doesn't use encryption on ViewState data.
Impact
An attacker can study the application's state management logic for possible vulnerabilities and if your application stores application-critical information in the ViewState; it will also be revealed.
Remedy
ASP.NET provides encryption for ViewState parameters.
For page based protection, place the following directive at the top of affected page.
<%@Page ViewStateEncryptionMode="Always" %>
You can also set this option for the whole application by using web.config files. Apply the following configuration for your application's web.config file.
HTTP/1.1 200 OK Cache-Control: private, no-store Content-Length: 12803 Content-Type: text/html; charset=utf-8 p3p: CP=ALL DSP COR CURa TAIi PSAa OUR BUS PHY ONL UNI FIN COM NAV DEM HEA PRE OTC Set-Cookie: ASP.NET_SessionId=tembcg455e5n0mmde0go4g45; path=/; HttpOnly,SessionTokenIdentifier=3548343233; path=/ Date: Tue, 03 May 2011 01:10:27 GMT
<html xmlns="http://www.w3.org/1999/xhtml" > <head id="ctl00_Head1"><meta http-equiv="Pragma" content="no-cache" /><meta http-equiv="Expires" content="-1" /><meta http-equiv="CACHE-CONTROL" content="NO-CACHE" /><title> Nationwide Building Society - Internet Banking </title>
<script language="javascript" type="text/javascript"> function ShowHelp() { // will always open in centre of screen, regardless of screen resolution var popUpWidth = 640; var popUpHeight = 480; var x = ((screen.width - popUpWidth)/2); var y = ((screen.height - popUpHeight)/2); window.status='Sign On';
<div id="header-nav"> <p id="header-blurb">Welcome to Nationwide's Internet Banking</p> <ul id="header-nav-secondary"> <li><a href="javascript:ShowDemo();" onmouseover="window.status='Demonstration of this site';return true;" onmouseout="window.status='';return true;" title="Demonstration of this site"><b>Demo</b></a></li> <li><a href="javascript:ShowHelp();" onmouseover="window.status='View help topics for this page';return true;" onmouseout="window.status='';return true;" title="View help topics for this page"><b>Help</b></a></li> </ul> </div> </div> <div id="main-content" style="position:absolute; top:115px;" >
<script type="text/javascript"> function msg1() {window.status="Please enter your 10-digit Customer Number"}
function PageLoadEvents() { document.aspnetForm.ctl00_cphMainContent_txtScreenResolution.value = screen.width + " x " + screen.height; document.aspnetForm.ctl00_cphMainContent_txtPersistentCookies.value = persistentCookiesEnabled(); var visitortime = new Date(); var timeZone = "" if (visitortime) { document.aspnetForm.ctl00_cphMainContent_txtTimeZone.value = (-(visitortime.getTimezoneOffset()/60)); } document.aspnetForm.ctl00_cphMainContent_txtReferringUri.value = document.referrer; document.aspnetForm.txt3548343233.focus();
checkforcookie();
}
function persistentCookiesEnabled() { var cookieName = "OlbTempTestCookie"; var expireDate = new Date(); expireDate.setDate(expireDate.getDate() + 2); document.cookie = cookieName + "=" + cookieName +"; path=/; expires=" + expireDate.toGMTString(); var start = document.cookie.indexOf(cookieName + "=" + cookieName); if (document.cookie.indexOf(cookieName + "=" + cookieName) > -1) { document.cookie = cookieName + "=; path=/; expires=Thu, 01-Jan-1970 00:00:01 GMT"; return true; } return false; }
function getCookie(sCookieName) { var aCookie = document.cookie.split("; ");
for (var i=0; i < aCookie.length; i++) { var thisCookie = aCookie[i].split("=");
if (sCookieName == thisCookie[0]) return unescape(thisCookie[1]); }
<div class="question-set"> <label for="chkboxRememberName" class="checkbox"><input id="ctl00_cphMainContent_chkboxRememberNum" type="checkbox" name="ctl00$cphMainContent$chkboxRememberNum" onclick="javascript:setTimeout('__doPostBack(\'ctl00$cphMainContent$chkboxRememberNum\',\'\')', 0)" tabindex="3" /> Remember my customer number*</label> <p>*Only select this if this is your computer and it is not used by anyone else</p>
</div>
</div> </div> <p class="warning">For security reasons, when you have finished using Internet Banking always select SIGN OFF.</p> </div> <div id="sign-on-my-save"> <h2>Sign on to MySave</h2> <div id="my-save-info"> <img src="/images/my-save.gif" alt="MySave Online Savings - Manage your MySave account online" /> <a id="ctl00_cphMainContent_linkWhatsThis" href="http://www.nationwide.co.uk/savings/aboutmysave.htm" target="_blank">What is MySave?</a> </div> <div id="my-save-sign-on"> <p>Sign on to your MySave account</p> <input type="submit" name="ctl00$cphMainContent$btnMySave" value="Go to MySave >>" id="ctl00_cphMainContent_btnMySave" tabindex="3" class="button" /> </div> </div> </div>
HTTP/1.1 403 Forbidden Cache-Control: No-cache Content-Length: 210 Content-Type: text/html Expires: -1 p3p: CP=ALL DSP COR CURa TAIi PSAa OUR BUS PHY ONL UNI FIN COM NAV DEM HEA PRE OTC Date: Tue, 03 May 2011 01:10:28 GMT
<html><head><title>Error</title></head><body><head><title>Application Pool Access Denied</title></head><body><h1>The specified request cannot be executed from current Application Pool</h1></body></body></html>