Wavlink AC3000 nas.cgi add_dir() command injection vulnerabilities
The Wavlink AC3000 router's nas.cgi binary passes user-supplied POST parameters disk_part and adddir_name directly into shell commands without sanitisation. An authenticated attacker can inject shell commands to execute arbitrary code on the device.
Originally disclosed on Cisco Talos
Multiple command execution vulnerabilities exist in the nas.cgi adddir() 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 add_dir function uses user-controlled input from the disk_part and adddir_name parameters in do_system() calls without sanitisation, allowing command injection.
What the attacker needed
Valid session cookie (authenticated user); network access to the router's web interface
The fix
The vendor has discontinued the product but is working on patches; the proper fix is to sanitise user input before passing it to shell commands.
How it was found
- Log in to the router's web interface to obtain a valid session cookie.
- Send an HTTP POST request to nas.cgi with page=adddir and a crafted disk_part or adddir_name parameter containing shell metacharacters.
- The router executes the injected command with the privileges of the web server.
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 has a feature to create directories. When you type a folder name or choose a disk, the router runs a system command like 'mkdir' using your input. Because it doesn't check for special characters, an attacker can add extra commands that the router will also run, taking full control of the device.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.