Skip to content
RCE Advisory Intermediate CVE-2024-39360

Wavlink AC3000 nas.cgi remove_dir() Command Injection Vulnerability

The nas.cgi binary on the Wavlink AC3000 router passes the user-supplied dir_path parameter directly into a system command without sanitisation. An authenticated attacker can inject shell commands and execute arbitrary code on the device.

Lilith >_> Follow

Originally disclosed on Cisco Talos

Critical 9.1 View original

An os command injection vulnerability exists in the nas.cgi removedir() functionality of Wavlink AC3000 M33A8.V5030.210505. A specially crafted HTTP request can lead to arbitrary code 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

Root cause

The remove_dir function calls do_system with a format string that includes the unsanitised dir_path parameter, allowing command injection.

Impact

An authenticated attacker can execute arbitrary commands on the router, potentially leading to full compromise of the device.

What the attacker needed

Valid session cookie (authenticated user); network access to the router's web interface

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=rmdir and a crafted dir_path parameter containing shell metacharacters.
  3. The router executes the injected command with the privileges of the nas.cgi process.

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 manage files. One of the actions, removing a directory, takes a folder name from the user and puts it into a system command without checking it. By putting special characters in the folder name, an attacker can make the router run their own commands, giving them 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.

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.