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 |
Document Title: =============== Easy FTP Pro v4.2 iOS - Command Inject Vulnerabilities References (Source): ==================== http://www.vulnerability-lab.com/get_content.php?id=1291 Release Date: ============= 2014-08-06 Vulnerability Laboratory ID (VL-ID): ==================================== 1291 Common Vulnerability Scoring System: ==================================== 5.7 Product & Service Introduction: =============================== The Best FTP and SFTP client for iPhone and iPad! Easy FTP is an FTP (File Transfer Protocol) and SFTP client for iPhone/iPod Touch. Easy FTP offer all the features of a desktop client. Also includes a web browser that allow to download files, audio player, mp4, avi,... video player, Dropbox, also helps you to access files on your remote computer (Mac, Windows, Linux), NAS Servers, and more. ( Copy of the Homepage: https://itunes.apple.com/en/app/easy-ftp-pro/id429071149 ) Abstract Advisory Information: ============================== The Vulnerability Laboratory Research Team discovered two command injection web vulnerabilities in the official Easy FTP Pro v4.2 iOS mobile application. Vulnerability Disclosure Timeline: ================================== 2014-08-06: Public Disclosure (Vulnerability Laboratory) Discovery Status: ================= Published Affected Product(s): ==================== Juan Ramon Rivero Product: Easy FTP Pro - iOS Mobile Web Application 4.2 Exploitation Technique: ======================= Remote Severity Level: =============== Medium Technical Details & Description: ================================ Two local command inject web vulnerabilities has been discovered in the official Easy FTP Pro v4.2 iOS mobile application. The vulnerability allows remote attackers to inject own commands by usage of misconfigured stored system/device values to compromise the apple mobile iOS application. The first vulnerability is located in the vulnerable <code>foldername</code> value of the <code>easy ftp wifi</code> module. Local attackers are able to inject own malicious system specific commands or path value requests in the vulnerable <code>foldername</code> input value. The execution of the command occurs in the <code>File Dir Index Listing</code> module of the easy ftp pro v4.2 mobile application. The attacker is able to manipulate the local device values with physical or restricted acccess to compromise the mobile application by preparing to change the foldername. The encoding of the vulnerable values in the <code>File Dir Index Listing module is broken. The second vulnerability is also located in the <code>�asy ftp wifi</code> module. The same attack like on changing a foldername can be exploited by attacker through the regular filename validation. The attacker is able to manipulate the local device values with physical or restricted acccess to compromise the mobile application by preparing to change the filename. The attack vector is located on the application-side and the injection requires physical device access or a local low privileged device user account. Local attackers are also able to exploit the albumname validation issue in combination with persistent injected script codes. The security risk of the local command/path inject vulnerability is estimated as medium with a cvss (common vulnerability scoring system) count of 5.7. Exploitation of the command/path inject vulnerability requires a low privileged iOS device account with restricted access and no user interaction. Successful exploitation of the vulnerability results in unauthorized execution of system specific commands and unauthorized path value requests to compromise the mobile iOS application or the connected device components. Request Method(s): [+] [Sync] Vulnerable Module(s): [+] Add File & Rename File + Import [+] Add Folder & Rename Folder + Import Vulnerable Parameter(s): [+] foldername [+] filename Affected Module(s): [+] File Dir Index Listing Proof of Concept (PoC): ======================= The local command inject web vulnerabilities can be exploited by local attackers with low privileged or restricted device user account with physical access and without user interaction. For security demonstration or to reproduce the vulnerability follow the provided information and steps below to continue. PoC #1: --- PoC Session Logs [GET] (Execution) --- Status: pending[] GET http://localhost:8080/[LOCAL COMMAND INJECT VULNERABILITY!] Load Flags[VALIDATE_ALWAYS ] Gr��e des Inhalts[unknown] Mime Type[unknown] Request Header: Host[localhost:8080] User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0] Accept[image/png,image/*;q=0.8,*/*;q=0.5] Accept-Language[de,en-US;q=0.7,en;q=0.3] Accept-Encoding[gzip, deflate] Referer[http://localhost:8080/] 12:26:56.763[0ms][total 0ms] Status: 200[OK] GET http://localhost:8080/index Load Flags[LOAD_DOCUMENT_URI] Gr��e des Inhalts[unknown] Mime Type[unknown] Request Header: Host[localhost:8080] User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Firefox/31.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/] 12:27:11.166[0ms][total 0ms] Status: Aus dem Cache geladen[Aus dem Cache geladen] GET http://localhost:8080/# Load Flags[LOAD_FROM_CACHE] Gr��e des Inhalts[-1] Mime Type[unbekannt] Request Header: Host[localhost:8080] User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Firefox/31.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] PoC: Source Foldername - File Dir Index Listing <script type="text/javascript" charset="utf-8"> function eliminaArchivo(archNombre){ $.post("/delete/"+archNombre, function(data) { cargaLista(rutaActual); }); } function comprueba(){ var fullPath = document.getElementById('uploadFile').value; if (fullPath) { var startIndex = (fullPath.indexOf('\\') >= 0 ? fullPath.lastIndexOf('\\') : fullPath.lastIndexOf('/')); var filename = fullPath.substring(startIndex); if (filename.indexOf('\\') === 0 || filename.indexOf('/') === 0) { filename = filename.substring(1); } filenombre = filename; } return true; } var rutaActual = ''; function confirma(nombre){ var borrar = confirm("Do you really want to delete: "+unescape(nombre)+"?"); if (borrar == true){ //return true; eliminaArchivo(nombre); } return false; } function cargaLista(ruta){ $("#filelist").empty(); $("#folder").empty(); var send = ruta; if(ruta == '..'){ if(rutaActual.lastIndexOf('/')>=0) send = rutaActual.substr(0,rutaActual.lastIndexOf('/')); else send = ''; } $.ajaxSetup({cache: false}); $.getJSON('/files/'+send/*'/files/'+ruta*/, function(data){ var shadow = false; //console.log(data); rutaActual = data.currentDir; $('#folder').append('Current path: Documents/' +data.currentDir); $.each(data.files, function(i,item){ var trclass=''; if (shadow) trclass= " class='shadow'"; encodeName = (encodeURI(rutaActual)+'/'+item.name).replace("'", "'"); var html = ''; if(item.type == 'FILE') html += "<tr" + trclass + "><td class='icon'> </td><td class='filename'><a href='https://www.exploit-db.com/files/" + encodeName + "' class='file'>" + decodeURI(item.name) + "</a></td>" + "<td class='size'>" + item.tam + "</td>";else html += "<tr" + trclass + "><td class='icon'><img src=\"folder.png\" alt=\"folder\" height=20 width=20/></td><td class='filename'> <a href='javascript:cargaLista(\"" + encodeURI(item.path).replace("'", "'") + "\")' class='file'>" + decodeURI(item.name) + "</a></td>"+"<td class='size'> </td>"; html += "<td class='date'>" + item.date + "</td>" + "<td class='del'><a href='https://www.exploit-db.com/exploits/34305/#' onclick='confirma(\""+escape(decodeURI(encodeURI(rutaActual)+'/'+item.name)).replace("'", "'")+"\")'><img src=\"delete.gif\" alt=\"folder\" height=20 width=20 style=\"border:0;\" /></a></td></tr>"; $(html).appendTo("#filelist"); shadow = !shadow; }); }) .error(function(){ alert('Connection error. Check if the web sharing is on and the iphone/ipod still connected to the network.'); }); } $.ajaxSetup({cache: true}); $(document).ready(function(){ cargaLista(''); }); </script> PoC #2: --- PoC Session Logs [GET] (Execution) --- Status: 200[OK] GET http://localhost:8080/files/%3[LOCAL COMMAND INJECT VULNERABILITY!]_=1407321412178 Load Flags[LOAD_BACKGROUNDVALIDATE_ALWAYS ] Gr��e des Inhalts[42] Mime Type[application/x-unknown-content-type] Request Header: Host[localhost:8080] User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0] Accept[application/json, text/javascript, */*; q=0.01] 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[42] Date[Wed, 06 Aug 2014 10:37:15 GMT] Status: pending[] GET http://localhost:8080/..%3C/[LOCAL COMMAND INJECT VULNERABILITY!] Load Flags[LOAD_DOCUMENT_URI] Gr��e des Inhalts[unknown] Mime Type[unknown] Request Header: Host[localhost:8080] User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Firefox/31.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/] PoC: Source Filename - File Dir Index Listing <div id="tlista"> <table border="0" cellpadding="0" cellspacing="0"> <thead> <tr> <th class="icon"><a href="javascript:cargaLista('..')" class="file"> <img src="https://www.exploit-db.com/exploits/34305/back.png" alt="back" border="0/" height="20" width="20"></a> </th> <th class="filename"> Name </th> <th class="size"> Size </th> <th class="date"> Modified </th> <th class="del"> <a href="javascript:cargaLista(rutaActual)" class="file"> <img src="https://www.exploit-db.com/exploits/34305/refresh.png" alt="back" border="0/" height="16" width="16"></a> </th> </tr> </thead> </table> <table border="0" cellpadding="0" cellspacing="0"> <tbody id="filelist"><tr><td class="icon"><img src="https://www.exploit-db.com/exploits/34305/folder.png" alt="folder" height="20" width="20"></td><td class="filename"> <a href="javascript:cargaLista("h[LOCAL COMMAND INJECT VULNERABILITY!])" class="file">[LOCAL COMMAND INJECT VULNERABILITY!]"></a></td> <td class='size'> </td><td class='date'>06.08.14 12:27</td><td class='del'><a href='https://www.exploit-db.com/exploits/34305/#' onclick='confirma("/[LOCAL COMMAND INJECT VULNERABILITY!]")'> <img src="https://www.exploit-db.com/exploits/34305/delete.gif" alt="folder" height=20 width=20 style="border:0;" /></a></td></tr></tbody></table></iframe></a></td></tr></tbody> Solution - Fix & Patch: ======================= The vulnerabilities can be patched by a secure parse and encode of the vulnerable file- and foldername values. Restrict the local app user input on both values to prevent further command injection attacks. Do not forget to parse the affected output listing in the file dir listing. Security Risk: ============== The security risk of both command inject web vulnerabilities in the file- and foldername values are estimated as medium(+). 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 |