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