Wavlink AC3000 qos.cgi qos_sta_settings() buffer overflow vulnerability
A stack-based buffer overflow exists in the qos_sta_settings function of the qos.cgi binary on Wavlink AC3000 routers. An authenticated attacker can send a crafted HTTP request with overly long cli_list and cli_num parameters to overflow a fixed-size buffer and potentially execute arbitrary code.
Originally disclosed on Cisco Talos
A buffer overflow vulnerability exists in the qos.cgi qosstasettings() functionality of Wavlink AC3000 M33A8.V5030.210505. A specially crafted HTTP request can lead to stack-based buffer overflow.
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 function uses sprintf to copy user-supplied cli_list and cli_num strings into a fixed-size stack buffer without any length check.
Impact
An authenticated attacker could achieve arbitrary code execution on the device, potentially leading to full compromise.
What the attacker needed
Valid session cookie (authenticated); network access to the device
How it was found
- Log in to the router's web interface to obtain a valid session cookie.
- Send an HTTP POST request to qos.cgi with page=qos_sta and overly long cli_list and cli_num parameters.
- The qos_sta_settings function copies the parameters into a fixed-size buffer, 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.
A buffer overflow happens when a program copies more data into a fixed-size memory area than it can hold, causing the extra data to spill over and overwrite nearby memory. Here, the router's web server takes two input fields from a form and combines them into a command without checking their length, so a very long input can overwrite the return address, which tells the program where to continue after the function finishes. An attacker who is logged in could exploit this to run their own code on the router.
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.