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.
A CRLF (New line) injection in HTTP headers was identified. This means that the input goes into HTTP headers without proper input filtering.
Impact
Depending on the application. An attacker might carry out the following forms of attacks:
Cross-site Scripting attack which can lead to session hijacking
Session fixation attack by setting a new cookie, which can again lead to session hijacking
Actions to Take
See the remedy for solution.
Ensure the server security patches are up to date and that the current stable version of the software is in use.
Remedy
Do not allow newline characters in input. Where possible use strict white listing.
Required Skills for Successful Exploitation
Crafting the attack to exploit this issue is not a complex process. However most of the unsophisticated attackers will not know that such an attack is possible. Also an attacker needs to reach his victim by an e-mail or other similar method in order to entice them to visit the site or click upon a URL.
"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.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <link rel="stylesheet" type="text/css" href="../scripts/e_common.css"> <HEAD> <META HTTP-EQUIV="PowerSiteData" NAME="SERVERLANGUAGE" CONTENT="Java"> <LINK href="../scripts/e_common.css" type="text/css" rel="stylesheet"> <META content="PB9.0.1.7048" name="GENERATOR"> <META http-equiv="Content-Type" content="text/html; charset=windows-1252"> <SCRIPT language="javascript" src="../scripts/e_callHelp.js" type="text/javascript"></SCRIPT> <SCRIPT language="JAVASCRIPT"> function inputvalidate() { if (FORM1.PASSWD.value == "") { alert ("Please enter a password to logon"); return false; } return commonvalidate(); } function commonvalidate() { if (FORM1.ORG_ID.value == "") { alert("Please enter an Organization ID to logon"); return false; } if (FORM1.USER_ID.value == "") { alert("Please enter a User ID to logon"); return false; } if (isNaN(FORM1.ORG_ID.value)) { alert("Please enter a numeric Organization ID to logon"); return false; } return true; } </SCRIPT> <SCRIPT language="JAVASCRIPT"> if (top.location == self.location ) { top.location.href = "e_logonframe.htm"; } </SCRIPT> </HEAD> <BODY language="JAVASCRIPT" onload="FORM1.ORG_ID.focus();" PSPARAMS="">
<BR><BR> <FORM id="FORM1" name="FORM1" action="e_validatelogon.jsp" method="post" target="_top"> <TABLE class='gap' width="100%" border="0"> <TR> <TD class="PageHeader2 ctr" align="middle"> MERS<SUP>®</SUP> eRegistry </TD> </TR> <TR> <TD class='ctr'> <TABLE class='entry' width='260' border=0> <TR> <TH colSpan=2>Please enter your logon credentials below.</TH> </TR> <TR> <TD class=label width='140'>Organization ID:</TD> <TD><INPUT id=ORG_ID name=ORG_ID size=12 maxLength=7></TD> </TR> <TR> <TD class=label>User ID:</TD> <TD><INPUT id=USER_ID name=USER_ID size=12 maxLength=8></TD> </TR> <TR> <TD class=label>Password:</TD> <TD><INPUT id=PASSWD name=PASSWD type=password size=12 maxLength=12></TD> </TR> </TABLE> </TD> </TR> <TR><TD> </TD></TR> <TR> <TD class='ctr gap' > <INPUT language="JavaScript" id="loginButton" type="submit" value="Logon" name="LOGONSUBMIT" onclick="return inputvalidate();"> </TD> </TR> </TABLE> <P></P> <TABLE width="100%"> <TR> <TD class='ctr'> <P class='help'>If you have forgotten your password, please enter your Organization ID and User ID and click "Forgot My Password".</P> </TD> </TR> </TABLE> <P></P> <TABLE width="100%"> <TR> <TD class='ctr'> <INPUT language="JavaScript" value='Forgot My Password' id=forgotButton name=forgotButton type=submit onclick="return commonvalidate();"> </TD> </TR> </TABLE>
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.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <link rel="stylesheet" type="text/css" href="../scripts/e_common.css"> <TITLE>MERS OnLine Error</TITLE> <META content="text/html; charset=windows-1252" http-equiv="Content-Type"> </HEAD> <BODY> <P class='ctr PageHeader3'>MERS<SUP>®</SUP> eRegistry OnLine Error</P> <P class='ctr'>We were unable to process your last request. Please try again.</P> <P class='ctr'>If you still cannot access this page, please contact the MERS Help Desk at 1-888-680-6377.</P> </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.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <link rel="stylesheet" type="text/css" href="../scripts/e_common.css"> <HEAD> <META HTTP-EQUIV="PowerSiteData" NAME="SERVERLANGUAGE" CONTENT="Java"> <LINK href="../scripts/e_common.css" type="text/css" rel="stylesheet"> <META content="PB9.0.1.7048" name="GENERATOR"> <META http-equiv="Content-Type" content="text/html; charset=windows-1252"> <SCRIPT language="javascript" src="../scripts/e_callHelp.js" type="text/javascript"></SCRIPT> <SCRIPT language="JAVASCRIPT"> function inputvalidate() { if (FORM1.PASSWD.value == "") { alert ("Please enter a password to logon"); return false; } return commonvalidate(); } function commonvalidate() { if (FORM1.ORG_ID.value == "") { alert("Please enter an Organization ID to logon"); return false; } if (FORM1.USER_ID.value == "") { alert("Please enter a User ID to logon"); return false; } if (isNaN(FORM1.ORG_ID.value)) { alert("Please enter a numeric Organization ID to logon"); return false; } return true; } </SCRIPT> <SCRIPT language="JAVASCRIPT"> if (top.location == self.location ) { top.location.href = "e_logonframe.htm"; } </SCRIPT> </HEAD> <BODY language="JAVASCRIPT" onload="FORM1.ORG_ID.focus();" PSPARAMS="">
<BR><BR> <FORM id="FORM1" name="FORM1" action="e_validatelogon.jsp" method="post" target="_top"> <TABLE class='gap' width="100%" border="0"> <TR> <TD class="PageHeader2 ctr" align="middle"> MERS<SUP>®</SUP> eRegistry </TD> </TR> <TR> <TD class='ctr'> <TABLE class='entry' width='260' border=0> <TR> <TH colSpan=2>Please enter your logon credentials below.</TH> </TR> <TR> <TD class=label width='140'>Organization ID:</TD> <TD><INPUT id=ORG_ID name=ORG_ID size=12 maxLength=7></TD> </TR> <TR> <TD class=label>User ID:</TD> <TD><INPUT id=USER_ID name=USER_ID size=12 maxLength=8></TD> </TR> <TR> <TD class=label>Password:</TD> <TD><INPUT id=PASSWD name=PASSWD type=password size=12 maxLength=12></TD> </TR> </TABLE> </TD> </TR> <TR><TD> </TD></TR> <TR> <TD class='ctr gap' > <INPUT language="JavaScript" id="loginButton" type="submit" value="Logon" name="LOGONSUBMIT" onclick="return inputvalidate();"> </TD> </TR> </TABLE> <P></P> <TABLE width="100%"> <TR> <TD class='ctr'> <P class='help'>If you have forgotten your password, please enter your Organization ID and User ID and click "Forgot My Password".</P> </TD> </TR> </TABLE> <P></P> <TABLE width="100%"> <TR> <TD class='ctr'> <INPUT language="JavaScript" value='Forgot My Password' id=forgotButton name=forgotButton type=submit onclick="return commonvalidate();"> </TD> </TR> </TABLE>