Totolink X2000R boa formWsc peerRptPin OS command injection vulnerability
The router's web administration page for Wi-Fi setup passes a user-supplied PIN value straight into shell commands without escaping it. An attacker who is already logged in could send a crafted request to run arbitrary operating system commands on the device.
Originally disclosed on Cisco Talos
A OS command injection vulnerability exists in the boa formWsc peerRptPin 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 peerRptPin HTTP POST parameter is inserted into a shell command string with snprintf and then passed to system() without any escaping or validation.
Impact
An authenticated attacker could execute arbitrary OS commands on the router, leading to full compromise of the device.
What the attacker needed
Valid login on the router; network access to the web interface
How it was found
- Log in to the router's web interface via the login page.
- Send an HTTP POST request to the formWsc page with setPIN set to 0 and setRptPIN set to a non-zero value.
- Include a peerRptPin value containing shell metacharacters and commands.
- The device builds a shell command containing that value 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 page where you set up a Wi-Fi connection by typing in a PIN. The router takes whatever you type and hands it to the operating system as a command to run, without checking it first. So someone who can log in to the router could type extra commands and the router would run them, giving them control of the device.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.