Skip to content
RCE Advisory Advanced CVE-2024-39757

Wavlink AC3000 wireless.cgi AddMac() buffer overflow vulnerability

A stack-based buffer overflow exists in the AddMac() function of the wireless.cgi binary on Wavlink AC3000 routers. An authenticated attacker can send a crafted HTTP request with an overly long addMac parameter to overwrite the return address and execute arbitrary commands.

Lilith >_> Follow

Originally disclosed on Cisco Talos

Critical 9.1 View original

A stack-based buffer overflow vulnerability exists in the wireless.cgi AddMac() 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

Root cause

The AddMac function uses sprintf to copy the user-controlled addMac parameter into a fixed-size stack buffer without any length validation.

Impact

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

What the attacker needed

Valid session cookie; network access to the device

The fix

The vendor has discontinued the product but patches are being worked on; the function should validate the length of the addMac parameter before copying it.

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 wireless.cgi with page=AddMac and an overly long addMac parameter.
  3. The AddMac function copies the parameter into a stack buffer without length checking, overwriting the return address.
  4. Control flow is redirected, leading to 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.

A buffer overflow happens when a program copies more data into a fixed-size memory area than it can hold, causing nearby data to be overwritten. Here, the router's web server takes a user-supplied value and copies it into a small buffer without checking its length, letting an attacker overwrite the return address and run their own commands.

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.