Skip to content
Memory corruption Advisory Advanced CVE-2024-37357

Wavlink AC3000 adm.cgi set_TR069() buffer overflow vulnerability

A stack-based buffer overflow exists in the set_TR069 function of the adm.cgi binary on Wavlink AC3000 routers. An authenticated attacker can send a crafted HTTP request with an overly long TR069_local_port parameter to overwrite the return address and potentially execute arbitrary code.

Lilith >_> Follow

Originally disclosed on Cisco Talos

Critical 9.1 View original

A buffer overflow vulnerability exists in the adm.cgi setTR069() functionality of Wavlink AC3000 M33A8.V5030.210505. A specially crafted HTTP request can lead to stack-based buffer overflow.

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 set_TR069 function uses sprintf to copy the user-supplied TR069_local_port parameter 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)

The fix

The vulnerability should be fixed by adding length validation for the TR069_local_port parameter before copying it into the stack buffer.

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 adm.cgi with page=TR069 and a TR069_local_port parameter longer than 0x140 bytes.
  3. The set_TR069 function copies the parameter into a stack buffer using sprintf, causing a buffer overflow.
  4. The overflow overwrites the return address, leading to a crash or potential code 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 the extra data to spill over and overwrite nearby memory. Here, the router's web server takes a value from a form field and copies it into a small buffer on the stack without checking its length. An attacker who is logged in can send a very long value, crash the program, and possibly 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.

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.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.