nday exploit: netgear orbi unauthenticated command injection (CVE-2020-27861)
An unauthenticated command injection in the Netgear Orbi's UA_Parser utility allowed an attacker on the local network to execute arbitrary commands as root by sending a crafted DHCP hostname. The author reverse-engineered the firmware to find the vulnerable call to system() and built a working exploit despite character filtering and length limits.
As I’ve mentioned in previous posts, I’ve been hunting for bugs on the Netgear Orbi for about a year and half. A few weeks ago, I came across an advisory for an unauthenticated command injection vulnerability that was reported to Netgear back in December 2020 and realized that the vulnerable firmware version was the…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The UA_Parser utility passed a user-controlled DHCP hostname into a system() call without proper sanitisation, using double quotes that allowed shell expansion.
Impact
An attacker on the local network could execute arbitrary commands as root, leading to full device compromise; the exploit required bypassing character filtering and length limits, but the author achieved code execution.
What the attacker needed
Network-adjacent access; no authentication required
The fix
The vulnerability was fixed by replacing double quotes with single quotes around user-controlled values in the system() call.
How it was found
- Connect to the Orbi network with a static IP.
- Send a DHCP request with a custom hostname using udhcpc.
- Trigger a device scan by loading the Attached Devices page or making an unauthenticated request to the homepage.
- Observe the command execution via GDB or by the device rebooting.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A router runs a small program that reads the name a device sends when it joins the network. That name was placed directly into a command that the router runs as an administrator, so a malicious name could run any command. The author found this by comparing the old and new firmware and then crafted a special name that worked around the router's filters.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.