Wavlink AC3000 wireless.cgi set_wifi_basic() buffer overflow vulnerability
A stack-based buffer overflow exists in the set_wifi_basic function of the wireless.cgi binary on Wavlink AC3000 routers. An authenticated attacker can send a crafted HTTP request with an overly long SSID2G parameter to overwrite the return address and potentially execute arbitrary code.
Originally disclosed on Cisco Talos
A stack-based buffer overflow vulnerability exists in the wireless.cgi setwifibasic() 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
Root cause
The set_wifi_basic function uses sprintf to copy the user-supplied SSID2G parameter into a fixed-size stack buffer without any length validation.
Impact
An authenticated attacker could achieve arbitrary command execution on the device, potentially leading to full compromise.
What the attacker needed
Valid session cookie (authenticated); network access to the device
The fix
The text does not state a fix; the vendor indicated patches are being worked on, but the proper fix would be to validate the length of the SSID2G parameter before copying it into the stack buffer.
How it was found
- Log in to the router's web interface to obtain a valid session cookie.
- Send an HTTP POST request to wireless.cgi with page=basic and an overly long SSID2G parameter.
- The set_wifi_basic function copies the SSID2G value into a stack buffer using sprintf, overflowing it and overwriting the return address.
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 report describes a memory corruption bug in a router's web interface. When the router processes a form field for the Wi-Fi network name, it copies the text into a fixed-size memory area without checking length. If the text is too long, it spills over and can overwrite the instructions that tell the router what to do next, letting an attacker take control.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.