peplink Surf SOHO HW1 data.cgi xfer_dns OS command injection vulnerability
An authenticated user with write privileges could inject shell metacharacters through the domain parameter of the DNS zone transfer endpoint, because the value was placed into a shell command without proper filtering. This allowed arbitrary commands to run with root privileges on the router.
Originally disclosed on Cisco Talos
An OS command injection vulnerability exists in the data.cgi xferdns functionality of peplink Surf SOHO HW1 v6.3.5 (in QEMU). A specially crafted HTTP request can lead to command 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 domain parameter is inserted into a shell command string without adequate escaping, and the validation only rejects a small set of characters.
Impact
An authenticated attacker with write privileges could execute arbitrary commands as root on the device.
What the attacker needed
Authenticated user with write privileges
How it was found
- Authenticate to the device web interface as a user with write privileges.
- Send an HTTP POST request to the data.cgi endpoint with option set to xfer_dns and step set to view_domain.
- Supply a crafted domain parameter that escapes the intended command.
- The command executes with root privileges.
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.
The router's web admin page builds a system command using text supplied by the user. It only blocks a few special characters, so other characters can break out of the intended command and run extra commands as the administrator. The attacker must already be logged in with write access.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.