Wavlink AC3000 nas.cgi set_nas() proftpd Configuration Control Vulnerabilities
The Wavlink AC3000 router's nas.cgi set_nas() function stores user-supplied FTP configuration parameters into NVRAM without sanitising newline characters, which are later written into the proftpd configuration file. An authenticated attacker can inject arbitrary proftpd directives, such as changing the default root directory, to gain filesystem access and potentially a shell.
Originally disclosed on Cisco Talos
Multiple external config control vulnerabilities exist in the nas.cgi setnas() proftpd functionality of Wavlink AC3000 M33A8.V5030.210505. A specially crafted HTTP request can lead to permission bypass.
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
Impact
An authenticated attacker could inject proftpd configuration to gain directory traversal to any directory accessible to the FTP user, which can quickly lead to gaining a shell on the system.
What the attacker needed
Authenticated access to the router's web interface; network access to the device
The fix
The report does not state a fix; the vendor indicated patches are being worked on, but the proper fix would be to sanitise newline characters in the affected parameters before writing them to the configuration file.
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=nas and include a parameter such as ftp_name containing a newline followed by a proftpd directive.
- The router stores the parameter in NVRAM and then runs storage.sh ftp, which writes the value into /etc/proftpd.conf.
- The injected directive, for example DefaultRoot /, takes effect, allowing access to the entire filesystem via FTP.
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 you can set up an FTP server. The page that saves these settings doesn't check for special characters like line breaks. An attacker who is already logged in can add extra lines to the FTP server's configuration file, which can give them access to the whole file system instead of just the shared folder.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.