Readonly to Root Privilege Escalation on EdgeSwitch
An authenticated read-only user could execute arbitrary shell commands through the HTTP interface, allowing privilege escalation to root. The vulnerabilities were found in EdgeSwitch firmware v1.9.0 and fixed in v1.9.1.
- Triaged in 25 days
- Fixed in 2 months
- Paid in 56 days
- Disclosed after 15 months
Summary by the program
An authenticated read-only user can execute arbitrary shell commands over the HTTP interface, allowing them to escalate privileges. These vulnerabilities were found on EdgeSwitch 1G switch (ESWH) and EdgeSwitch 10G switch (ESGH) firmware v1.9.0.
The fix for these vulnerabilities were included in the EdgeMax EdgeSwitch firmware v1.9.1 For more details please visit:
What the report shows
The target is the HTTP management interface of Ubiquiti EdgeSwitch switches, specifically the EdgeSwitch 1G (ESWH) and EdgeSwitch 10G (ESGH) models running firmware v1.9.0. The weakness is classed as command injection, and the program's summary states the outcome plainly: an authenticated user who holds only read-only privileges can execute arbitrary shell commands over the HTTP interface, and from there escalate to full privileges.
The report does not walk through individual requests, parameters or payloads. It records the affected models, the firmware version, the privilege level required (an authenticated read-only account) and the channel used (the HTTP interface). No bounty figure is given, and the report does not describe the vulnerable endpoint or the exact injection point.
The fix shipped in EdgeMax EdgeSwitch firmware v1.9.1. The report points readers to the release notes and the download page for that version:
https://community.ui.com/releases/EdgeMAX-EdgeSwitch-Firmware-v1-9-1-v1-9-1/8a87dfc5-70f5-4055-8d67-570db1f5695c
https://www.ui.com/download/edgemax
The severity recorded for the report is high, with a CVSS score of 8.8.
Root cause
The report does not name the vulnerable function or parameter. What it implies is the usual pattern for this class on embedded management interfaces: a value supplied through the web interface is passed to a shell without adequate sanitisation or quoting, so shell metacharacters in that value are interpreted by the underlying operating system rather than treated as data.
Impact
Within the report's own framing, the impact is privilege escalation: a user who should only be able to view the device's state can run arbitrary shell commands and move to root. On a network switch that means full control of the device. The report does not enumerate specific post-exploitation actions, so the practical ceiling is best described as complete compromise of the switch from a low-privileged authenticated session.
How this kind of bug works
Command injection happens when an application builds a shell command from untrusted input and hands the result to a shell interpreter. The shell treats characters such as ;, |, &, backticks, $() and newlines as syntax, so input that was meant to be a single argument can terminate the intended command and start another. The same class appears when input is passed to functions that invoke a shell implicitly, or when arguments are concatenated into a string instead of being passed as an array.
Embedded and network device interfaces are especially prone to it because they often wrap system utilities (ping, traceroute, tcpdump, configuration scripts, firmware tools) that are convenient to call through a shell. Authorisation is frequently checked at the routing layer, while the handler that performs the action runs with elevated service privileges, which is how a read-only role can end up executing code.
The defences are well understood: avoid the shell entirely by using APIs that take argument arrays, validate input against a strict allowlist, escape and quote anything that must reach a shell, and run handlers with the least privilege so that a bypass of the UI role does not translate into a system-level compromise.
How to test for it
- Map every feature that causes the device to run a system operation: diagnostics such as ping and traceroute, DNS lookups, packet capture, log export, configuration backup and restore, firmware and certificate handling, time and NTP settings, and any field that ends up in a filename or path.
- For each, capture the request and identify the parameters that plausibly reach a command line. Note which role is required to send it, and test with the lowest-privileged account you have.
- Send benign probes first: a value containing a shell metacharacter followed by a command whose effect is observable and harmless, such as a short sleep or a write to a temporary path you can read back through another feature.
- Compare behaviour against a control request with the same value but no metacharacters. A positive result is a change in timing, output, or state that only the injected command could have produced.
- Escalate carefully: confirm the identity the command runs as, then stop. Do not make persistent changes on production hardware.
Common false positives include reflected input that merely appears in a response, error messages that echo the payload, and timing differences caused by network conditions rather than a sleep. Confirm with a second, independent observable effect before reporting.
How it is fixed
The report states the fix was included in firmware v1.9.1 but does not describe the change. Where a system utility must be invoked, call it through an interface that passes arguments separately, and validate each argument against a strict pattern (for example, hostnames and addresses only). Where a shell is unavoidable, quote and escape every interpolated value and reject metacharacters outright. On top of that, handlers should run with the least privilege needed, and authorisation checks should be applied at the handler itself, not only at the route, so that a read-only session cannot reach privileged operations.
Hunting notes
This class tends to hide in features that exist to run diagnostics or manipulate files: anything with a hostname, address, interface name, filename or free-text field that a backend script consumes. On network and IoT devices, look at the management UI, the API behind it, and any legacy CGI or form handlers that predate the current front end.
Recon signals include firmware release notes that mention input validation or command handling, endpoints that return command output, and features that shell out to standard utilities. Comparing behaviour between privilege levels is often the quickest way to spot a missing check.
To get a report accepted, show the lowest privilege level that can reach the vulnerable request, demonstrate execution with a harmless, reproducible command, and state the resulting privilege level. Keep the proof minimal and reversible, and avoid touching production configuration beyond what is needed to prove the point.
What happened, in plain words
A network switch is the box in a server room or office that connects computers together and moves data between them. Ubiquiti makes two models of EdgeSwitch, the EdgeSwitch 1G (short name ESWH) and the EdgeSwitch 10G (ESGH). Like many business devices, they have a web page you open in a browser to manage them: check status, change settings, run diagnostics. That web page is called the HTTP management interface, because HTTP is the same protocol your browser uses to load ordinary websites.
Accounts on such a device usually come in levels. An administrator can change everything. A read-only user can log in and look, but is not supposed to change anything. The whole point of a read-only account is that it is safe to hand to someone who only needs to check the device.
This report shows that on firmware v1.9.0, that safety promise did not hold. A person logged in with only read-only rights could send commands to the underlying operating system of the switch through the web interface, and those commands ran. From there they could escalate their privileges.
The weakness is classed as command injection. In plain terms: the web interface takes something a user types or sends, and passes it to the operating system in a way that lets the user sneak extra commands in alongside the intended one. It is like a form at a counter that asks for your name, and the clerk reads your name out loud to a colleague in the back room; if you write "Alice, and also open the safe" on the form, the clerk may read the whole line and the colleague may obey both parts.
The report records the affected models, the firmware version, the privilege level needed (an authenticated read-only account) and the channel used (the HTTP interface). It does not walk through individual requests, parameters or payloads, and it does not name the vulnerable endpoint or the exact injection point. No bounty figure is given. The severity recorded is high, with a CVSS score of 8.8. CVSS is a standard scoring system for how serious a security flaw is; 8.8 out of 10 sits in the high band.
The fix shipped in EdgeMax EdgeSwitch firmware v1.9.1. The report points readers to the release notes and the download page for that version:
https://community.ui.com/releases/EdgeMAX-EdgeSwitch-Firmware-v1-9-1-v1-9-1/8a87dfc5-70f5-4055-8d67-570db1f5695c
https://www.ui.com/download/edgemax
The first link is the vendor's release announcement for v1.9.1, the second is the page where the firmware can be downloaded. The report states the fix was included in firmware v1.9.1.
In general, how this kind of bug works
Command injection happens when a program builds a command for the operating system out of text it does not fully trust, and hands the result to a shell. A shell is the program that reads typed commands and runs them; on Linux-style systems it also understands punctuation with special meaning. Characters such as ;, |, &, backticks, $() and newlines are syntax to a shell, not ordinary text. A semicolon, for example, means "and then run the next command". So if a value meant to be a single harmless argument contains a semicolon, the shell may treat everything after it as a second command.
The same class of bug appears when input is passed to functions that quietly invoke a shell, or when pieces of a command are glued together into one string instead of being passed as a list of separate arguments.
Network and embedded devices are especially prone to it, because their web interfaces often wrap handy system tools: ping, traceroute, packet capture, configuration scripts, firmware tools. These are convenient to call through a shell. A second problem is where permission checks live. Often the web interface checks your role when it decides which page to show, but the piece of code that actually performs the action runs with the privileges of a background service, not of you. That is how a read-only role can end up running code as a more powerful user.
The defences are well understood:
- Avoid the shell entirely by calling tools through interfaces that take arguments separately, so punctuation stays punctuation.
- Validate input against a strict allowlist, for example accept only well-formed hostnames and addresses.
- Where a shell is unavoidable, quote and escape every inserted value and reject metacharacters outright.
- Run handlers with the least privilege they need, and check authorisation in the handler itself, not only at the page that leads to it.
In general, how to test for it
If you are testing a device like this with permission, a sensible order is:
- Map every feature that makes the device run a system operation: diagnostics such as ping and traceroute, DNS lookups, packet capture, log export, configuration backup and restore, firmware and certificate handling, time and NTP settings, and any field that ends up in a filename or path.
- For each one, capture the request and note which parameters could plausibly reach a command line. Note which role is needed to send it, and test with the lowest-privileged account you have.
- Send benign probes first: a value containing a shell metacharacter followed by a command whose effect you can observe and that does no harm, such as a short sleep or a write to a temporary path you can read back through another feature.
- Compare against a control request with the same value but no metacharacters. A positive result is a change in timing, output or state that only the injected command could have produced.
- Escalate carefully: confirm which user the command runs as, then stop. Do not make persistent changes on production hardware.
Common false positives include input that merely appears again in the response, error messages that echo what you sent, and timing differences caused by the network rather than by a sleep. Confirm with a second, independent observable effect before reporting.
To get a report accepted, show the lowest privilege level that can reach the vulnerable request, demonstrate execution with a harmless, reproducible command, and state the resulting privilege level. Keep the proof minimal and reversible, and avoid touching production configuration beyond what is needed to prove the point.
Glossary
- HTTP: the protocol browsers use to fetch web pages and send form data; the management interface of the switch speaks it.
- HTTP management interface: the web pages a device exposes so administrators can view and change its settings.
- Firmware: the software built into a device, updated as a whole package; here version v1.9.0 was affected and v1.9.1 fixed it.
- Authenticated: logged in with a valid account.
- Read-only user: an account allowed to view information but not to change settings.
- Privilege escalation: gaining a higher level of access than the account was meant to have.
- Root: the all-powerful account on a Linux-style system, able to do anything on the device.
- Shell: the program that reads commands and runs them, and that gives punctuation such as
;and|special meaning. - Command injection: a flaw where untrusted input is turned into part of an operating system command, letting an attacker run extra commands.
- Shell metacharacter: a character with special meaning to the shell, such as
;,|,&, backticks,$()or a newline. - Sanitisation: cleaning or checking input so that dangerous characters cannot do harm.
- Allowlist: a list of exactly what is permitted, with everything else rejected.
- Least privilege: giving each account and each piece of code only the access it truly needs.
- Endpoint: a specific address on a web server that handles a particular action.
- Parameter: a named value sent with a request, such as a hostname typed into a form.
- Payload: the crafted input an attacker sends to trigger a flaw.
- CVSS: a standard scoring system for the severity of security flaws, from 0 to 10.
- False positive: a result that looks like a vulnerability but is not one.
- NTP: the protocol devices use to keep their clocks accurate.
- CGI: an older way for a web server to run a program to produce a page, common on embedded devices.