Wavlink AC3000 adm.cgi rep_as_router() buffer overflow vulnerability
A stack-based buffer overflow exists in the rep_as_router function of the adm.cgi binary on Wavlink AC3000 routers. An authenticated attacker can send a crafted HTTP request with an overly long wl_rep_ssid2g parameter to overwrite the return address and potentially execute arbitrary code.
Originally disclosed on Cisco Talos
A buffer overflow vulnerability exists in the adm.cgi repasrouter() 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 rep_as_router function copies the user-supplied wl_rep_ssid2g parameter into a fixed-size stack buffer without checking its length.
Impact
An authenticated attacker could overwrite the return address and potentially execute arbitrary code on the device.
What the attacker needed
Valid session cookie (authenticated); network access to the device
The fix
The vendor is working on patches, but no fix is described in the text.
How it was found
- Log in to the router's web interface to obtain a valid session cookie.
- Send an HTTP POST request to adm.cgi with page=wzdrepeater and rep_type set to a value other than '1' or 'Mesh'.
- Include a ModelType parameter set to 'AP' and a wl_rep_ssid2g parameter longer than 0xa0 bytes.
- The rep_as_router function copies the oversized wl_rep_ssid2g value to the stack, causing a buffer overflow and crash.
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 buffer overflow, a bug where a program copies too much data into a fixed-size memory space, causing it to spill over and overwrite nearby data. Here, an attacker who is logged in can send a very long Wi-Fi network name (SSID) to the router's web interface, which then crashes the program and could let the attacker run their own code on the device.
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.