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.
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.
// // In my case I want to load them onload, this is how you do it! // //Event.observe(window, 'load', loadAccordions, false);
// // Set up all accordions // function loadAccordions() { var topAccordion = new accordion('vertical_container', { classNames : { toggle : 'vertical_accordion_toggle', toggleActive : 'vertical_accordion_toggle_active', content : 'vertical_accordion_content' }, defaultSize : { width : 750 }, direction : 'vertical' });
var bottomAccordion = new accordion('vertical_container');
var nestedVerticalAccordion = new accordion('vertical_nested_container', { classNames : { toggle : 'vertical_accordion_toggle', toggleActive : 'vertical_accordion_toggle_active', content : 'vertical_accordion_content' } });
// Open first one bottomAccordion.activate($$('#vertical_container .accordion_toggle')[0]);
// Open second one //topAccordion.activate($$('#horizontal_container .horizontal_accordion_toggle')[2]); }
function Poktoconvert(clientid,productid) { var msg = 'Are you sure you want to convert this expired '+productid+' to LAM1A?'; if (confirm(msg)) location="../order/convtolam1a.cfm?clientid=" + clientid + "&productid=" + productid; }
function Poktoactivate(clientid) { var msg = 'Please confirm: ok to activate your membership?';
if (confirm(msg)) location="../order/activatemembership.cfm?clientid=" + clientid; }
</script>
<script type="text/javascript"> if (window.ColdFusion) ColdFusion.required['username']=true;</script><script type="text/javascript"> if (window.ColdFusion) ColdFusion.required['pw']=true;</script><script type="text/javascript"><!-- _CF_checkCFForm_1 = function(_CF_this) { //reset on submit _CF_error_exists = false; _CF_error_messages = new Array(); _CF_error_fields = new Object(); _CF_FirstErrorField = null; //form element username required check if( !_CF_hasValue(_CF_this['username'], "TEXT", false ) ) { _CF_onError(_CF_this, "username", _CF_this['username'].value, "Enter your user id"); _CF_error_exists = true; } //form element pw required check if( !_CF_hasValue(_CF_this['pw'], "PASSWORD", false ) ) { _CF_onError(_CF_this, "pw", _CF_this['pw'].value, "Enter password"); _CF_error_exists = true; } //display error messages and return success if( _CF_error_exists ) { if( _CF_error_messages.length > 0 ) { // show alert() message _CF_onErrorAlert(_CF_error_messages); // set focus to first form error, if the field supports js focus(). if( _CF_this[_CF_FirstErrorField].type == "text" ) { _CF_this[_CF_FirstErrorField].focus(); } } return false; }else { return true; } }//--></script></HEAD>
<BODY>
<DESCRIPTION></DESCRIPTION>
<script language="JavaScript" type="text/JavaScript"> <!-- function lamin() { stateval = ""; for(var i=0; i < lamform.stateprovince.options.length; i++) if (lamform.stateprovince.options[i].selected) stateval = lamform.stateprovince.options[i].value; if (lamform.ac.value>0 && stateval!='') { alert("Select either the area code OR the state but not both"); return false; } } //--> </script>
<A HREF="http://www.mediate.com/index.cfm"><IMG SRC="https://www.mediate.com/micart/nav_top_lft_2009.gif" WIDTH="427" HEIGHT="87" BORDER="0" alt="Mediate.com - Complete information about mediation and mediators"></A></td>
"Auto Complete" was enabled in one or more of the form fields. These were either "password" fields or important fields such as "Credit Card".
Impact
Data entered in these fields will be cached by the browser. An attacker who can access the victim's browser could steal this information. This is especially important if the application is commonly used in shared computers such as cyber cafes or airport terminals.
Remedy
Add the attribute autocomplete="off" to the form tag or to individual "input" fields.
Actions to Take
See the remedy for the solution.
Find all instances of inputs which store private data and disable autocomplete. Fields which contain data such as "Credit Card" or "CCV" type data should not be cached. You can allow the application to cache usernames and remember passwords, however, in most cases this is not recommended.
Re-scan the application after addressing the identified issues to ensure that all of the fixes have been applied properly.
Required Skills for Successful Exploitation
Dumping all data from a browser can be fairly easy and there exist a number of automated tools to undertake this. Where the attacker cannot dump the data, he/she could still browse the recently visited websites and activate the auto-complete feature to see previously entered values.
// // In my case I want to load them onload, this is how you do it! // //Event.observe(window, 'load', loadAccordions, false);
// // Set up all accordions // function loadAccordions() { var topAccordion = new accordion('vertical_container', { classNames : { toggle : 'vertical_accordion_toggle', toggleActive : 'vertical_accordion_toggle_active', content : 'vertical_accordion_content' }, defaultSize : { width : 750 }, direction : 'vertical' });
var bottomAccordion = new accordion('vertical_container');
var nestedVerticalAccordion = new accordion('vertical_nested_container', { classNames : { toggle : 'vertical_accordion_toggle', toggleActive : 'vertical_accordion_toggle_active', content : 'vertical_accordion_content' } });
// Open first one bottomAccordion.activate($$('#vertical_container .accordion_toggle')[0]);
// Open second one //topAccordion.activate($$('#horizontal_container .horizontal_accordion_toggle')[2]); }
function Poktoconvert(clientid,productid) { var msg = 'Are you sure you want to convert this expired '+productid+' to LAM1A?'; if (confirm(msg)) location="../order/convtolam1a.cfm?clientid=" + clientid + "&productid=" + productid; }
function Poktoactivate(clientid) { var msg = 'Please confirm: ok to activate your membership?';
if (confirm(msg)) location="../order/activatemembership.cfm?clientid=" + clientid; }
</script>
<script type="text/javascript"> if (window.ColdFusion) ColdFusion.required['username']=true;</script><script type="text/javascript"> if (window.ColdFusion) ColdFusion.required['pw']=true;</script><script type="text/javascript"><!-- _CF_checkCFForm_1 = function(_CF_this) { //reset on submit _CF_error_exists = false; _CF_error_messages = new Array(); _CF_error_fields = new Object(); _CF_FirstErrorField = null; //form element username required check if( !_CF_hasValue(_CF_this['username'], "TEXT", false ) ) { _CF_onError(_CF_this, "username", _CF_this['username'].value, "Enter your user id"); _CF_error_exists = true; } //form element pw required check if( !_CF_hasValue(_CF_this['pw'], "PASSWORD", false ) ) { _CF_onError(_CF_this, "pw", _CF_this['pw'].value, "Enter password"); _CF_error_exists = true; } //display error messages and return success if( _CF_error_exists ) { if( _CF_error_messages.length > 0 ) { // show alert() message _CF_onErrorAlert(_CF_error_messages); // set focus to first form error, if the field supports js focus(). if( _CF_this[_CF_FirstErrorField].type == "text" ) { _CF_this[_CF_FirstErrorField].focus(); } } return false; }else { return true; } }//--></script></HEAD>
<BODY>
<DESCRIPTION></DESCRIPTION>
<script language="JavaScript" type="text/JavaScript"> <!-- function lamin() { stateval = ""; for(var i=0; i < lamform.stateprovince.options.length; i++) if (lamform.stateprovince.options[i].selected) stateval = lamform.stateprovince.options[i].value; if (lamform.ac.value>0 && stateval!='') { alert("Select either the area code OR the state but not both"); return false; } } //--> </script>
<A HREF="http://www.mediate.com/index.cfm"><IMG SRC="https://www.mediate.com/micart/nav_top_lft_2009.gif" WIDTH="427" HEIGHT="87" BORDER="0" alt="Mediate.com - Complete information about mediation and mediators"></A></td>
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.
// // In my case I want to load them onload, this is how you do it! // //Event.observe(window, 'load', loadAccordions, false);
// // Set up all accordions // function loadAccordions() { var topAccordion = new accordion('vertical_container', { classNames : { toggle : 'vertical_accordion_toggle', toggleActive : 'vertical_accordion_toggle_active', content : 'vertical_accordion_content' }, defaultSize : { width : 750 }, direction : 'vertical' });
var bottomAccordion = new accordion('vertical_container');
var nestedVerticalAccordion = new accordion('vertical_nested_container', { classNames : { toggle : 'vertical_accordion_toggle', toggleActive : 'vertical_accordion_toggle_active', content : 'vertical_accordion_content' } });
// Open first one bottomAccordion.activate($$('#vertical_container .accordion_toggle')[0]);
// Open second one //topAccordion.activate($$('#horizontal_container .horizontal_accordion_toggle')[2]); }
function Poktoconvert(clientid,productid) { var msg = 'Are you sure you want to convert this expired '+productid+' to LAM1A?'; if (confirm(msg)) location="../order/convtolam1a.cfm?clientid=" + clientid + "&productid=" + productid; }
function Poktoactivate(clientid) { var msg = 'Please confirm: ok to activate your membership?';
if (confirm(msg)) location="../order/activatemembership.cfm?clientid=" + clientid; }
</script>
<script type="text/javascript"> if (window.ColdFusion) ColdFusion.required['username']=true;</script><script type="text/javascript"> if (window.ColdFusion) ColdFusion.required['pw']=true;</script><script type="text/javascript"><!-- _CF_checkCFForm_1 = function(_CF_this) { //reset on submit _CF_error_exists = false; _CF_error_messages = new Array(); _CF_error_fields = new Object(); _CF_FirstErrorField = null; //form element username required check if( !_CF_hasValue(_CF_this['username'], "TEXT", false ) ) { _CF_onError(_CF_this, "username", _CF_this['username'].value, "Enter your user id"); _CF_error_exists = true; } //form element pw required check if( !_CF_hasValue(_CF_this['pw'], "PASSWORD", false ) ) { _CF_onError(_CF_this, "pw", _CF_this['pw'].value, "Enter password"); _CF_error_exists = true; } //display error messages and return success if( _CF_error_exists ) { if( _CF_error_messages.length > 0 ) { // show alert() message _CF_onErrorAlert(_CF_error_messages); // set focus to first form error, if the field supports js focus(). if( _CF_this[_CF_FirstErrorField].type == "text" ) { _CF_this[_CF_FirstErrorField].focus(); } } return false; }else { return true; } }//--></script></HEAD>
<BODY>
<DESCRIPTION></DESCRIPTION>
<script language="JavaScript" type="text/JavaScript"> <!-- function lamin() { stateval = ""; for(var i=0; i < lamform.stateprovince.options.length; i++) if (lamform.stateprovince.options[i].selected) stateval = lamform.stateprovince.options[i].value; if (lamform.ac.value>0 && stateval!='') { alert("Select either the area code OR the state but not both"); return false; } } //--> </script>
<A HREF="http://www.mediate.com/index.cfm"><IMG SRC="https://www.mediate.com/micart/nav_top_lft_2009.gif" WIDTH="427" HEIGHT="87" BORDER="0" alt="Mediate.com - Complete information about mediation and mediators"></A></td>
<html><head><title>Error</title></head><body><head><title>Directory Listing Denied</title></head><body><h1>Directory Listing Denied</h1>This Virtual Directory does not allow contents to be listed.</body></body></html>
Netsparker found e-mail addresses on the web site.
Impact
E-mail addresses discovered within the application can be used by both spam email engines and also brute force tools. Furthermore valid email addresses may lead to social engineering attacks .
Remedy
Use generic email addresses such as contact@ or info@ for general communications, remove user/people specific e-mail addresses from the web site, should this be required use submission forms for this purpose.
HTTP/1.1 200 OK Connection: close Date: Fri, 22 Apr 2011 00:42:49 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET server-error: true Content-Type: text/html; charset=UTF-8
<html>
<body> <br>
We're sorry - - An Error Occured. <br>We have been automatically notified.<br> If <b>YOU</b> wish to be informed when this error is tracked down and fixed, then <br> <a href="mailto:server@kargo.net?subject=WebSite Error at {ts '2011-04-21 17:42:49'}">click here.</a><br> Thanks
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.
// // In my case I want to load them onload, this is how you do it! // //Event.observe(window, 'load', loadAccordions, false);
// // Set up all accordions // function loadAccordions() { var topAccordion = new accordion('vertical_container', { classNames : { toggle : 'vertical_accordion_toggle', toggleActive : 'vertical_accordion_toggle_active', content : 'vertical_accordion_content' }, defaultSize : { width : 750 }, direction : 'vertical' });
var bottomAccordion = new accordion('vertical_container');
var nestedVerticalAccordion = new accordion('vertical_nested_container', { classNames : { toggle : 'vertical_accordion_toggle', toggleActive : 'vertical_accordion_toggle_active', content : 'vertical_accordion_content' } });
// Open first one bottomAccordion.activate($$('#vertical_container .accordion_toggle')[0]);
// Open second one //topAccordion.activate($$('#horizontal_container .horizontal_accordion_toggle')[2]); }
function Poktoconvert(clientid,productid) { var msg = 'Are you sure you want to convert this expired '+productid+' to LAM1A?'; if (confirm(msg)) location="../order/convtolam1a.cfm?clientid=" + clientid + "&productid=" + productid; }
function Poktoactivate(clientid) { var msg = 'Please confirm: ok to activate your membership?';
if (confirm(msg)) location="../order/activatemembership.cfm?clientid=" + clientid; }
</script>
<script type="text/javascript"> if (window.ColdFusion) ColdFusion.required['username']=true;</script><script type="text/javascript"> if (window.ColdFusion) ColdFusion.required['pw']=true;</script><script type="text/javascript"><!-- _CF_checkCFForm_1 = function(_CF_this) { //reset on submit _CF_error_exists = false; _CF_error_messages = new Array(); _CF_error_fields = new Object(); _CF_FirstErrorField = null; //form element username required check if( !_CF_hasValue(_CF_this['username'], "TEXT", false ) ) { _CF_onError(_CF_this, "username", _CF_this['username'].value, "Enter your user id"); _CF_error_exists = true; } //form element pw required check if( !_CF_hasValue(_CF_this['pw'], "PASSWORD", false ) ) { _CF_onError(_CF_this, "pw", _CF_this['pw'].value, "Enter password"); _CF_error_exists = true; } //display error messages and return success if( _CF_error_exists ) { if( _CF_error_messages.length > 0 ) { // show alert() message _CF_onErrorAlert(_CF_error_messages); // set focus to first form error, if the field supports js focus(). if( _CF_this[_CF_FirstErrorField].type == "text" ) { _CF_this[_CF_FirstErrorField].focus(); } } return false; }else { return true; } }//--></script></HEAD>
<BODY>
<DESCRIPTION></DESCRIPTION>
<script language="JavaScript" type="text/JavaScript"> <!-- function lamin() { stateval = ""; for(var i=0; i < lamform.stateprovince.options.length; i++) if (lamform.stateprovince.options[i].selected) stateval = lamform.stateprovince.options[i].value; if (lamform.ac.value>0 && stateval!='') { alert("Select either the area code OR the state but not both"); return false; } } //--> </script>
<A HREF="http://www.mediate.com/index.cfm"><IMG SRC="https://www.mediate.com/micart/nav_top_lft_2009.gif" WIDTH="427" HEIGHT="87" BORDER="0" alt="Mediate.com - Complete information about mediation and mediators"></A></td>