Wavlink AC3000 adm.cgi rep_as_bridge() buffer overflow vulnerability
A stack-based buffer overflow exists in the rep_as_bridge function of the adm.cgi binary on the Wavlink AC3000 router. 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 repasbridge() 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_bridge function uses sprintf to copy the user-controlled wl_rep_ssid2g parameter into a fixed-size stack buffer without any length check.
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)
The fix
The vendor stated that patches are being worked on, but no fix was confirmed at the time of the report.
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=1.
- Include a wl_rep_ssid2g parameter longer than 0xa0 bytes to overflow the stack buffer.
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 memory to be overwritten. Here, the router's web server takes a user-supplied value and copies it without checking its length, so an attacker can overwrite the return address and redirect the program's execution. This requires being logged in to the router's web interface.
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.