Wavlink AC3000 nas.cgi set_nas() samba Configuration Control Vulnerability
The router's nas.cgi set_nas() function writes user-supplied Samba configuration values into /etc/smb.conf without filtering, allowing an authenticated attacker to inject arbitrary Samba configuration lines. By using the 'root preexec' directive, the attacker can execute arbitrary shell commands when someone connects to the Samba server.
Originally disclosed on Cisco Talos
An external config control vulnerability exists in the nas.cgi setnas() 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
Impact
An authenticated attacker can execute arbitrary commands with root privileges on the router, potentially leading to full compromise.
What the attacker needed
Valid session cookie (authenticated); network access to the router
The fix
The vendor has discontinued the product but is working on patches; the fix should involve sanitising user input to prevent newline injection into configuration files.
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 the parameters smb_enabled=1, smb_workgroup, and smb_netbios containing newline characters and a malicious Samba configuration directive.
- The router writes the smb_netbios value into /etc/smb.conf, injecting the malicious configuration.
- Connect to the Samba service to trigger the injected 'root preexec' command, resulting in arbitrary command 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 runs a web interface that lets you configure Samba file sharing. The code that saves your Samba settings does not check what you type, so you can sneak in extra configuration lines. Those extra lines can tell the router to run any command you want, giving an attacker 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.