Skip to content
main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 

Command injection at the web management interface of EdgeRouter-x(6)

Overview

* Type: command injection
* Supplier: UniFi (https://www.ui.com/)
* Product: EdgeMax EdgeRouter-x, latest firmware version v2.0.9-hotfix.6
* Firmware download: https://www.ui.com/download/edgemax/edgerouter-x/er-x
* Affect version: v2.0.9-hotfix.6

Overview of the Vulnerability

A command injection vulnerability allows commands to be executed remotely on EdgeRouter-X by crafting a request within the web application where there should be no context to access or execute code.

This command injection exists at the 'ecn-down' parameter will carry the user's data which isn't sanitized(corresponding to poc code line 67-68). With an elaborately crafted payload into the 'ecn-down' parameter, the device will execute the command in the payload.

The vulnerability allows a malicious attacker authenticated on the web to execute commands on the device, enabling an attacker to gain the highest privilege of the system(ie. root privilege) and take over the device without any interaction.

Steps to Reproduce

I have put the PoC (exp.py) in the attachments. Configure several parameters, and execute it, you will see an outputting ping echo from the target device(that is the injected command has been executed). The parameters are as below:

  1. username, password: user who is the administrator on the web (default: ubnt, ubnt).
  2. device_web_ip: web IP address of the target device.
  3. ping_target: Usually configured as the local host. The device will send a ping echo to this host.

Proof of Concept

You can open Wireshark to monitor the ICMP flow. After executing the PoC, you will see a ping echo from the device to the 'ping_target' host. You can also set 'inject_cmd' to any other OS commands, such as 'touch /etc/test' will set up a file named 'test' under the critical directory '/etc'. Open the cli on the web to check the touched file.