Totolink X2000R boa formUpload() OS command injection vulnerability
The formUpload() function in the Totolink X2000R router builds a shell command from user-supplied device MAC parameters without sanitisation and executes it with system(). An authenticated attacker can inject arbitrary OS commands, leading to code execution.
Originally disclosed on Cisco Talos
A OS command injection 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
Root cause
User-controlled devicemac%d parameters are copied into a buffer and then formatted into an Mcli command string that is passed to system() without sanitisation.
Impact
An authenticated attacker could execute arbitrary OS commands on the router, potentially leading to full compromise.
What the attacker needed
Authenticated access 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 login page.
- Send an HTTP POST to the formUpload endpoint with a crafted firmware buffer that passes validation without flashing.
- Include a deviceNum parameter to control the loop count and enable%d parameters set to non-zero.
- Supply devicemac%d parameters containing shell metacharacters.
- The router builds an Mcli command from these values and executes it with system().
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 router's web admin page lets you upload firmware and set mesh device details. The code takes the device MAC address you type and pastes it directly into a command that the router's operating system runs. Because special characters in that text are not cleaned, an attacker who is already logged in can add their own commands and make the router run them.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.