Skip to content
RCE Advisory Intermediate CVE-2024-39602

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.

Lilith >_> Follow

Originally disclosed on Cisco Talos

Critical 9.1 View original

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.

Lilith >_>, on Cisco Talos

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

  1. Log in to the router's web interface to obtain a valid session cookie.
  2. 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.
  3. The router writes the smb_netbios value into /etc/smb.conf, injecting the malicious configuration.
  4. 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.

More by Lilith >_>

View all

148 more disclosed reports, best first.

More from Cisco Talos

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.