Wavlink AC3000 adm.cgi set_TR069() command injection vulnerability
The Wavlink AC3000 router's adm.cgi set_TR069() function fails to sanitise the TR069_local_port parameter, allowing an authenticated attacker to inject shell commands that are executed by the system. This leads to arbitrary command execution with root privileges.
Originally disclosed on Cisco Talos
A command execution vulnerability exists in the adm.cgi setTR069() functionality of Wavlink AC3000 M33A8.V5030.210505. A specially crafted HTTP request can lead to arbitrary command execution.
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 report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The TR069_local_port parameter is passed directly into a sprintf call that builds an iptables command, which is then executed via system() without any validation or escaping.
Impact
An authenticated attacker can execute arbitrary commands on the router with root privileges, potentially leading to full compromise of the device.
What the attacker needed
Valid session cookie (authenticated)
How it was found
- Log in to the router's web interface to obtain a valid session cookie.
- Send an HTTP POST request to adm.cgi with page=TR069 and a crafted TR069_local_port parameter containing shell metacharacters.
- The set_TR069 function reads the parameter and builds an iptables command using sprintf.
- The command is executed via system(), running the injected shell commands.
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 report has not been written yet. The Original tab links to the source.
This router has a web interface where an admin can configure settings. One setting, the TR069 local port, is used to build a command that runs on the router without checking if the input contains extra characters. An attacker who can log in can type something like '123; malicious-command' and the router will run that extra command as well, giving them full control.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.