Totolink X2000R batchupg OS command injection vulnerability
The router's firmware upload flow copies an attacker-supplied filename into a configuration file and later interpolates it into shell commands run by the batchupg binary. An authenticated attacker could therefore run arbitrary operating system commands on the device.
Originally disclosed on Cisco Talos
A OS command injection vulnerability exists in the batchupg 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
Likely the uploaded filename is stored unsanitised and then passed into sprintf-built shell command strings that are executed with system().
Impact
An authenticated attacker could execute arbitrary commands on the router, giving full compromise of the device.
What the attacker needed
Valid admin login on the router; ability to send broadcast UDP packets to port 13977; crafted firmware file accepted by the upload check
How it was found
- Log in to the web interface via the login form.
- Upload a crafted file through the file upload form so its filename is written into the firmware configuration file.
- Send a request to the upload settings form with matching values to restart the batchupg binary.
- Send a broadcast packet with the correct magic value, a non-default MAC, and a matching csid so the device is added to the upgrade list.
- The batchupg thread builds a shell command containing the stored filename and executes it.
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.
This router has a web admin page where you can upload a firmware file. The name you give that file is stored and later pasted straight into a command the router runs on its own operating system. Because the name is never cleaned, someone who can log in can put extra command text in the filename and make the router run it.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.