Latest YouTube Video

Tuesday, June 28, 2016

[FD] KL-001-2016-002 : Ubiquiti Administration Portal CSRF to Remote Command Execution

KL-001-2016-002 : Ubiquiti Administration Portal CSRF to Remote Command Execution Title: Ubiquiti Administration Portal CSRF to Remote Command Execution Advisory ID: KL-001-2016-002 Publication Date: 2016.06.28 Publication URL: http://ift.tt/29lwYW0 1. Vulnerability Details Affected Vendor: Ubiquiti Affected Product: AirGateway, AirFiber, mFi Affected Version: 1.1.6, 3.2, 2.1.11 Platform: Embedded Linux CWE Classification: CWE-352: Cross-Site Request Forgery (CSRF); CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection') Impact: Arbitrary Code Execution Attack vector: HTTP 2. Vulnerability Description The Ubiquiti AirGateway, AirFiber and mFi platforms feature remote administration via an authenticated web-based portal. Lack of CSRF protection in the Remote Administration Portal, and unsafe passing of user input to operating system commands exectuted with root privileges, can be abused in a way that enables remote command execution. 3. Technical Description The firmware files analyzed were AirGWP.v1.1.6.28062.150731.1520.bin, AF24.v3.2.bin, and firmware.bin respectively. The MD5 hash values for the vulnerable files served by the administration portal are: AirGateway b45fe8e491d62251f0a7a100c636178a /usr/www/system.cgi AirFiber d8926f7f65a2111f4036413f985082b9 /usr/www/system.cgi mFi 960e8f6e507b227dbc4b65fc7a7036bc /usr/www/system.cgi The firmware file contains a LZMA compressed, squashfs partition. The binaries running on the embedded device are compiled for a MIPS CPU. The device can be easily virtualized using QEMU: Example: sudo /usr/sbin/chroot . ./qemu-mips-static /usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf The administration portal does not issue a randomized CSRF token either per session, page, or request. Administration authorization is solely based on cookie control. Therefore, it is possible to embed JavaScript into an HTML page so when an administrator is socially engineered into visiting the page, the target device will be accessed with privileges. Device configuration POST parameters include tokens passed to operating system commands run as root in unsafe ways with insufficient input sanitization. Command injection is possible by stacking shell commands in parameters such as iptables.1.cmd. In order for a developer to recreate this discovery, the following instructions should be duplicated. a. Authenticate to the target web application and navigate to the SYSTEM page. b. Download the current configuration. c. Open the configuration in an editor of your choice, navigate to the line containing: iptables.1.cmd=-A FIREWALL -j ACCEPT d. Append the following onto that line: ;touch /var/tmp/csrf-to-rce.txt e. Save the changes, and submit the modified configuration. Apply the changes using apply.cgi afterward. Example: POST /system.cgi HTTP/1.1 Host: 192.168.1.1 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:43.0) Gecko/20100101 Firefox/43.0 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 DNT: 1 Referer: http://ift.tt/291MlnH Cookie: ui_language=en_US; last_check=1452020493426; AIROS_SESSIONID=e5f61a5c0a9d0690b4efd484e56b8c93 Connection: keep-alive Content-Type: multipart/form-data; boundary

Source: Gmail -> IFTTT-> Blogger

No comments: