
TheHostingTool 1.2.6: Multiple SQL Injection
Date: 2015-10-07 16:08:491. Introduction
Affected Product: | TheHostingTool 1.2.6 |
Fixed in: | not fixed |
Fixed Version Link: | n/a |
Vendor Website: | https://thehostingtool.com/ |
Vulnerability Type: | SQL Injection |
Remote Exploitable: | Yes |
Reported to vendor: | 09/07/2015 |
Disclosed to public: | 10/07/2015 |
Release mode: | Full Disclosure |
CVE: | n/a |
Credits | Tim Coen of Curesec GmbH |
2. Description
There are three SQL Injections in the admin area of TheHostingTool 1.2.6.
The problem is that the defense against SQL Injection depends in part on the global GET and POST variables being sanitized using mysql_real_escape_string if accessed via postvar or getvar.
This makes them relatively safe to use in a query if the parameter is surrounded by quotes. But for places where the parameter is not surrounded by quotes, this will not prevent SQL injection.
Please note that admin credentials are required for all SQL injections shown here.
3. Details
SQL Injection 1
The POST value "type" is used as the column name in a WHERE clause when using the ajax search. Encoding single quotes does not prevent SQL injection in this case.
It should also be noted that letting the user choose the column of a LIKE query on a user table is not a good idea in general, as it will be easy to iterate passwords this way.
Proof of Concept:
SQL Injection 2
The POST value "order" is used in an update query of an ajax request. Single quotes are encoded, but the parameter is not surrounded by single quotes, thus making it unnecessary for an attacker to use single quotes, as they do not have to break out of the context of a string.
Proof of Concept:
navbar` SET `order` = {$i} WHERE `id` = {$id}"); $i++; } } break;
SQL Injection 3
When updating the payment status of invoices, the "iid" GET parameter is put directly into multiple queries.
Proof of Concept:
4. Solution
This issue has not been fixed
5. Report Timeline
09/07/2015 | Informed Vendor about Issue (no reply) |
09/22/2015 | Reminded Vendor of disclosure date (no reply) |
10/07/2015 | Disclosed to public |