Totolink X2000R boa formUpload() stack-based buffer overflow vulnerability
A stack-based buffer overflow exists in the Totolink X2000R router's boa formUpload() function because the devicemac%d HTTP POST parameter is copied without length checking into a fixed-size stack buffer. An authenticated attacker could send a crafted request to execute arbitrary code on the device.
Originally disclosed on Cisco Talos
A stack-based buffer overflow vulnerability exists in the boa formUpload() 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
Impact
An authenticated attacker could achieve arbitrary code execution on the device, potentially leading to full compromise.
What the attacker needed
Authentication to the web interface; device in easy mesh mode or ability to enable it; crafted HTTP POST request
How it was found
- Authenticate to the router's web interface via the formLogin page.
- Send an HTTP POST request to the formUpload endpoint with a crafted firmware file that passes validation without flashing.
- Ensure the device is in easy mesh mode, or enable it through other requests.
- Include a deviceNum parameter to control the number of loop iterations.
- For each iteration, provide enable%d and devicemac%d parameters, with an overly long devicemac%d value 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 can overwrite nearby instructions. Here, a router's web interface takes a value from a form and copies it without checking its length, letting an attacker who is already logged in take control of 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.