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.

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.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Draft//EN"><HTML><HEAD><TITLE>Error 403--Forbidden</TITLE><META NAME="GENERATOR" CONTENT="WebLogic Server"></HEAD><BODY bgcolor="white"><FONT FACE=Helvetica><BR CLEAR=all><TABLE border=0 cellspacing=5><TR><TD><BR CLEAR=all><FONT FACE="Helvetica" COLOR="black" SIZE="3"><H2>Error 403--Forbidden</H2></FONT></TD></TR></TABLE><TABLE border=0 width=100% cellpadding=10><TR><TD VALIGN=top WIDTH=100% BGCOLOR=white><FONT FACE="Courier New"><FONT FACE="Helvetica" SIZE="3"><H3>From RFC 2068 <i>Hypertext Transfer Protocol -- HTTP/1.1</i>:</H3></FONT><FONT FACE="Helvetica" SIZE="3"><H4>10.4.4 403 Forbidden</H4></FONT><P><FONT FACE="Courier New">The server understood the request, but is refusing to fulfill it. Authorization will not help and the request SHOULD NOT be repeated. If the request method was not HEAD and the server wishes to make public why the request has not been fulfilled, it SHOULD describe the reason for the refusal in the entity. This status code is commonly used when the server does not wish to reveal exactly why the request has been refused, or when no other response is applicable.</FONT></P></FONT></TD></TR></TABLE></BODY></HTML>

"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.

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 Draft//EN"><HTML><HEAD><TITLE>Error 403--Forbidden</TITLE><META NAME="GENERATOR" CONTENT="WebLogic Server"></HEAD><BODY bgcolor="white"><FONT FACE=Helvetica><BR CLEAR=all><TABLE border=0 cellspacing=5><TR><TD><BR CLEAR=all><FONT FACE="Helvetica" COLOR="black" SIZE="3"><H2>Error 403--Forbidden</H2></FONT></TD></TR></TABLE><TABLE border=0 width=100% cellpadding=10><TR><TD VALIGN=top WIDTH=100% BGCOLOR=white><FONT FACE="Courier New"><FONT FACE="Helvetica" SIZE="3"><H3>From RFC 2068 <i>Hypertext Transfer Protocol -- HTTP/1.1</i>:</H3></FONT><FONT FACE="Helvetica" SIZE="3"><H4>10.4.4 403 Forbidden</H4></FONT><P><FONT FACE="Courier New">The server understood the request, but is refusing to fulfill it. Authorization will not help and the request SHOULD NOT be repeated. If the request method was not HEAD and the server wishes to make public why the request has not been fulfilled, it SHOULD describe the reason for the refusal in the entity. This status code is commonly used when the server does not wish to reveal exactly why the request has been refused, or when no other response is applicable.</FONT></P></FONT></TD></TR></TABLE></BODY></HTML>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Draft//EN"><HTML><HEAD><TITLE>Error 403--Forbidden</TITLE><META NAME="GENERATOR" CONTENT="WebLogic Server"></HEAD><BODY bgcolor="white"><FONT FACE=Helvetica><BR CLEAR=all><TABLE border=0 cellspacing=5><TR><TD><BR CLEAR=all><FONT FACE="Helvetica" COLOR="black" SIZE="3"><H2>Error 403--Forbidden</H2></FONT></TD></TR></TABLE><TABLE border=0 width=100% cellpadding=10><TR><TD VALIGN=top WIDTH=100% BGCOLOR=white><FONT FACE="Courier New"><FONT FACE="Helvetica" SIZE="3"><H3>From RFC 2068 <i>Hypertext Transfer Protocol -- HTTP/1.1</i>:</H3></FONT><FONT FACE="Helvetica" SIZE="3"><H4>10.4.4 403 Forbidden</H4></FONT><P><FONT FACE="Courier New">The server understood the request, but is refusing to fulfill it. Authorization will not help and the request SHOULD NOT be repeated. If the request method was not HEAD and the server wishes to make public why the request has not been fulfilled, it SHOULD describe the reason for the refusal in the entity. This status code is commonly used when the server does not wish to reveal exactly why the request has been refused, or when no other response is applicable.</FONT></P></FONT></TD></TR></TABLE></BODY></HTML>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Draft//EN"><HTML><HEAD><TITLE>Error 403--Forbidden</TITLE><META NAME="GENERATOR" CONTENT="WebLogic Server"></HEAD><BODY bgcolor="white"><FONT FACE=Helvetica><BR CLEAR=all><TABLE border=0 cellspacing=5><TR><TD><BR CLEAR=all><FONT FACE="Helvetica" COLOR="black" SIZE="3"><H2>Error 403--Forbidden</H2></FONT></TD></TR></TABLE><TABLE border=0 width=100% cellpadding=10><TR><TD VALIGN=top WIDTH=100% BGCOLOR=white><FONT FACE="Courier New"><FONT FACE="Helvetica" SIZE="3"><H3>From RFC 2068 <i>Hypertext Transfer Protocol -- HTTP/1.1</i>:</H3></FONT><FONT FACE="Helvetica" SIZE="3"><H4>10.4.4 403 Forbidden</H4></FONT><P><FONT FACE="Courier New">The server understood the request, but is refusing to fulfill it. Authorization will not help and the request SHOULD NOT be repeated. If the request method was not HEAD and the server wishes to make public why the request has not been fulfilled, it SHOULD describe the reason for the refusal in the entity. This status code is commonly used when the server does not wish to reveal exactly why the request has been refused, or when no other response is applicable.</FONT></P></FONT></TD></TR></TABLE></BODY></HTML>

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.