Totolink X2000R boa formIpv6Setup dhcp_dns stack-based buffer overflow vulnerabilities
The boa web server on the Totolink X2000R router copies the dhcp_dns1 and dhcp_dns2 HTTP POST parameters into fixed-size stack buffers without any length checks. An authenticated attacker can send an oversized value to overflow the stack and potentially execute arbitrary code.
Originally disclosed on Cisco Talos
Multiple exploitable stack-based buffer overflow vulnerabilities exist in the boa formIpv6Setup dhcpdns functionality of X2000R (version(s): TOTOLINK-X2000R-Gh-V1.0.0-B20250421.1327). A specially crafted HTTP request can lead to arbitrary code 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 formIpv6Setup function uses strcpy to copy the dhcp_dns1 and dhcp_dns2 POST parameters into fixed-size stack buffers without any bounds checking.
Impact
An authenticated attacker could achieve arbitrary code execution on the router, as demonstrated by control of the program counter in the crash.
What the attacker needed
Authenticated access to the web interface
How it was found
- Authenticate to the router's web interface via the login page.
- Send an HTTP POST request to the formIpv6Setup page with wan_enable set to a non-zero value.
- Set the OriginType parameter to 0x2 to select the DHCP configuration path.
- Provide an oversized value in the dhcp_dns1 or dhcp_dns2 parameter 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 space than it can hold, so the extra data spills over and corrupts nearby memory. Here, the router's web server takes a value from a form field and copies it into a small stack buffer without checking its length. By sending a very long value, an attacker can overwrite the memory that controls where the program goes next, which may let them run their own code.
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.