Vulnerabilities > CVE-2016-9048 - SQL Injection vulnerability in Processmaker 3.0.1.7

047910
CVSS 7.4 - HIGH
Attack vector
NETWORK
Attack complexity
LOW
Privileges required
LOW
Confidentiality impact
LOW
Integrity impact
LOW
Availability impact
LOW
network
low complexity
processmaker
CWE-89

Summary

Multiple exploitable SQL Injection vulnerabilities exists in ProcessMaker Enterprise Core 3.0.1.7-community. Specially crafted web requests can cause SQL injections. An attacker can send a web request with parameters containing SQL injection attacks to trigger this vulnerability, potentially allowing exfiltration of the database, user credentials and in certain setups access the underlying operating system.

Vulnerable Configurations

Part Description Count
Application
Processmaker
2

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Command Line Execution through SQL Injection
    An attacker uses standard SQL injection methods to inject data into the command line for execution. This could be done directly through misuse of directives such as MSSQL_xp_cmdshell or indirectly through injection of data into the database that would be interpreted as shell commands. Sometime later, an unscrupulous backend application (or could be part of the functionality of the same application) fetches the injected data stored in the database and uses this data as command line arguments without performing proper validation. The malicious data escapes that data plane by spawning new commands to be executed on the host.
  • Object Relational Mapping Injection
    An attacker leverages a weakness present in the database access layer code generated with an Object Relational Mapping (ORM) tool or a weakness in the way that a developer used a persistence framework to inject his or her own SQL commands to be executed against the underlying database. The attack here is similar to plain SQL injection, except that the application does not use JDBC to directly talk to the database, but instead it uses a data access layer generated by an ORM tool or framework (e.g. Hibernate). While most of the time code generated by an ORM tool contains safe access methods that are immune to SQL injection, sometimes either due to some weakness in the generated code or due to the fact that the developer failed to use the generated access methods properly, SQL injection is still possible.
  • SQL Injection through SOAP Parameter Tampering
    An attacker modifies the parameters of the SOAP message that is sent from the service consumer to the service provider to initiate a SQL injection attack. On the service provider side, the SOAP message is parsed and parameters are not properly validated before being used to access a database in a way that does not use parameter binding, thus enabling the attacker to control the structure of the executed SQL query. This pattern describes a SQL injection attack with the delivery mechanism being a SOAP message.
  • Expanding Control over the Operating System from the Database
    An attacker is able to leverage access gained to the database to read / write data to the file system, compromise the operating system, create a tunnel for accessing the host machine, and use this access to potentially attack other machines on the same network as the database machine. Traditionally SQL injections attacks are viewed as a way to gain unauthorized read access to the data stored in the database, modify the data in the database, delete the data, etc. However, almost every data base management system (DBMS) system includes facilities that if compromised allow an attacker complete access to the file system, operating system, and full access to the host running the database. The attacker can then use this privileged access to launch subsequent attacks. These facilities include dropping into a command shell, creating user defined functions that can call system level libraries present on the host machine, stored procedures, etc.
  • SQL Injection
    This attack exploits target software that constructs SQL statements based on user input. An attacker crafts input strings so that when the target software constructs SQL statements based on the input, the resulting SQL statement performs actions other than those the application intended. SQL Injection results from failure of the application to appropriately validate input. When specially crafted user-controlled input consisting of SQL syntax is used without proper validation as part of SQL queries, it is possible to glean information from the database in ways not envisaged during application design. Depending upon the database and the design of the application, it may also be possible to leverage injection to have the database execute system-related commands of the attackers' choice. SQL Injection enables an attacker to talk directly to the database, thus bypassing the application completely. Successful injection can cause information disclosure as well as ability to add or modify data in the database. In order to successfully inject SQL and retrieve information from a database, an attacker:

Seebug

bulletinFamilyexploit
description### Summary Multiple exploitable SQL Injection vulnerabilities exists in ProcessMarker Enterprise Core 3.0.1.7-community. Specially crafted web requests can cause SQL injections. An attacker can send a web request with parameters containing SQL injection attacks to trigger this vulnerability, potentially allowing exfiltration of the database, user credentials and in certain setups access the underlying operating system. ### Tested Versions ProcessMaker Enterprise Core 3.0.1.7-community ### Product URLs https://www.processmaker.com/community-2 ### CVSSv3 Score 7.4 - CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:L ### CWE CWE-89 - Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') ### Details SQL injection has been found and confirmed within ProcessMarker Enterprise Core. A successful attack could allow an attacker to access information such as usernames and password hashes that are stored in the database. The following URLs and parameters have been confirmed to suffer from SQL injections and could be exploited by autenticated attackers: ``` GET /sysworkflow/en/neoclassic/events/eventsAjax? request=eventList&start=1&limit=25&process=1&type=1&status=1&sort=[SQL INJECTION]&dir=ASC HTTP/1.1 Host: box User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-GB,en;q=0.5 Accept-Encoding: gzip, deflate DNT: 1 Cookie: workspaceSkin=neoclassic; PHPSESSID=PCSLlabz Connection: close POST /sysworkflow/en/neoclassic/cases/proxyPMTablesSaveFields.php HTTP/1.1 Host: box User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-GB,en;q=0.5 Accept-Encoding: gzip, deflate DNT: 1 Referer: http://box/sysworkflow/en/neoclassic/login/authentication.php Cookie: workspaceSkin=neoclassic; PHPSESSID=PCSLlabz Connection: close Content-Type: application/x-www-form-urlencoded Content-Length: 84 callback=1&dir=1&sort=[SQL INJECTION]&query=1&table=1&action=1 POST /sysworkflow/en/neoclassic/cases/proxyProcessList.php?t=1&callback=a&dir=/&query=13 HTTP/1.1 Host: box User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-GB,en;q=0.5 Accept-Encoding: gzip, deflate DNT: 1 Referer: http://box/sysworkflow/en/neoclassic/login/authentication.php Cookie: workspaceSkin=neoclassic; PHPSESSID=PCSLlabz Connection: close Content-Type: application/x-www-form-urlencoded Content-Length: 8 sort=[SQL INJECTION] GET /sysworkflow/en/neoclassic/tools/translationsAjax.php?function=changeLabel&cat=1[SQL INJECTION]&node=1&lang=1&langLabel=1&label=1 HTTP/1.1 Host: box User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-GB,en;q=0.5 Accept-Encoding: gzip, deflate DNT: 1 Referer: http://box/sysworkflow/en/neoclassic/login/authentication.php Cookie: workspaceSkin=neoclassic; PHPSESSID=PCSLlabz Connection: close GET /sysworkflow/en/neoclassic/tools/translationsAjax.php? function=changeLabel&cat=1&node=1&lang=1[SQL INJECTION]&langLabel=1&label=1 HTTP/1.1 Host: box User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-GB,en;q=0.5 Accept-Encoding: gzip, deflate DNT: 1 Referer: http://box/sysworkflow/en/neoclassic/login/authentication.php Cookie: workspaceSkin=neoclassic; PHPSESSID=PCSLlabz Connection: close GET /sysworkflow/en/neoclassic/tools/translationsAjax.php? function=changeLabel&cat=1&node=1[SQL INJECTION]&lang=1&langLabel=1&label=1 HTTP/1.1 Host: box User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-GB,en;q=0.5 Accept-Encoding: gzip, deflate DNT: 1 Referer: http://box/sysworkflow/en/neoclassic/login/authentication.php Cookie: workspaceSkin=neoclassic; PHPSESSID=PCSLlabz Connection: close GET /sysworkflow/en/neoclassic/tools/translationsAjax.php?function=changeLabel&cat=1[SQL INJECTION]&node=1&lang=1&langLabel=1&label=1 HTTP/1.1 Host: box User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-GB,en;q=0.5 Accept-Encoding: gzip, deflate DNT: 1 Referer: http://box/sysworkflow/en/neoclassic/login/authentication.php Cookie: workspaceSkin=neoclassic; PHPSESSID=PCSLlabz Connection: close GET /sysworkflow/en/neoclassic/tools/translationsAjax.php? function=changeLabel&cat=1&node=1&lang=1[SQL INJECTION]&langLabel=1&label=1 HTTP/1.1 Host: box User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-GB,en;q=0.5 Accept-Encoding: gzip, deflate DNT: 1 Referer: http://box/sysworkflow/en/neoclassic/login/authentication.php Cookie: workspaceSkin=neoclassic; PHPSESSID=PCSLlabz Connection: close GET /sysworkflow/en/neoclassic/tools/translationsAjax.php? function=changeLabel&cat=1&node=1[SQL INJECTION]&lang=1&langLabel=1&label=1 HTTP/1.1 Host: User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-GB,en;q=0.5 Accept-Encoding: gzip, deflate DNT: 1 Referer: http://box/sysworkflow/en/neoclassic/login/authentication.php Cookie: workspaceSkin=neoclassic; PHPSESSID=PCSLlabz Connection: close ``` Unauthenticated SQL injection: ``` GET /gulliver/genericAjax?request=storeInTmp&pkt=int&pk=[SQL Injection]&table=a[SQL Injection]&cnn=[CONNECTION NAME] HTTP/1.1 Host: 192.168.56.101 Accept: */* Accept-Language: en User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0) Connection: close ``` Note: For this SQL injection to work a 'cnn' parameter needs to be know as that is the parameter used to establish the connection with the database. The following code which can be directly invoked from the server presents this issue: ``` gulliver/methods/genericAjax.php 173 case 'storeInTmp': 174 try { 177 $con = Propel::getConnection($_GET['cnn']); 178 if($_GET['pkt'] == 'int'){ 179 $rs = $con->executeQuery("SELECT MAX({$_GET['pk']}) as lastId FROM {$_GET['table']};"); 180 $rs->next(); 181 $row = $rs->getRow(); 182 $gKey = (int)$row['lastId'] + 1; 183 184 } else { 185 $gKey = G::encryptOld(date('Y-m-d H:i:s').'@'.rand()); 186 } 187 188 $rs = $con->executeQuery("INSERT INTO {$_GET['table']} ({$_GET['pk']}, {$_GET['fld']}) VALUES ('$gKey', '{$_GET['value']}');"); 189 190 echo "{status: 1, message: \"success\"}"; 191 } catch (Exception $e) { 192 $err = $e->getMessage(); 193 //$err = eregi_replace("[\n|\r|\n\r]", ' ', $err); 194 $err = preg_replace("[\n|\r|\n\r]", " ", $err); //Made compatible to PHP 5.3 195 196 echo "{status: 0, message: \"" . $err . "\"}"; 197 } 198 break; 199 } 200 } ``` ### Mitigation Restrict access to known, trusted users and hosts. ### Timeline * 2016-02-15 - Vendor Disclosure * 2017-07-19 - Public Release ### CREDIT * Discovered by Jerzy Kramarz of Portcullis Computer Security Limited.
idSSV:96472
last seen2017-11-19
modified2017-09-14
published2017-09-14
reporterRoot
titleProcessMaker Enterprise Core Multiple SQL Injection Vulnerabilities(CVE-2016-9048)

Talos

idTALOS-2017-0313
last seen2019-05-29
published2017-07-19
reporterTalos Intelligence
sourcehttp://www.talosintelligence.com/vulnerability_reports/TALOS-2017-0313
titleProcessMaker Enterprise Core Multiple SQL Injection Vulnerabilities