Wavlink AC3000 adm.cgi sch_reboot() OS command injection vulnerabilities
The Wavlink AC3000 router's adm.cgi sch_reboot() function fails to sanitise the restart_hour, restart_min, and restart_week parameters, allowing an authenticated attacker to inject arbitrary crontab entries and execute commands as root.
Originally disclosed on Cisco Talos
Multiple OS command injection vulnerabilities exist in the adm.cgi schreboot() functionality of Wavlink AC3000 M33A8.V5030.210505. A specially crafted HTTP request can lead to a arbitrary code 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 sch_reboot function concatenates user-supplied restart_hour, restart_min, and restart_week values into a crontab line without sanitisation, then writes it to NVRAM and later to the crontab file.
Impact
An authenticated attacker could execute arbitrary commands with root privileges on the router.
What the attacker needed
Authenticated access to the router's web interface
The fix
The vulnerabilities should be fixed by sanitising the restart_hour, restart_min, and restart_week parameters before using them in a crontab entry.
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=sch_reboot and include the restart_hour, restart_min, and restart_week parameters.
- Inject a crafted value into one of these parameters to add a malicious crontab entry.
- The router writes the injected line to the SCH_Reboot NVRAM variable and later to the crontab file.
- The cron daemon executes the injected command, leading to arbitrary code execution.
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's web interface lets an admin schedule reboots. The scheduling form takes three time fields and builds a system command without cleaning them. An attacker who is already logged in can put extra commands in those fields, and the router will run them with 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.