Peplink Smart Reader web interface mac2name OS command injection vulnerability
An OS command injection vulnerability in the mac2name functionality of the Peplink Smart Reader web interface allows an authenticated attacker to execute arbitrary commands with root privileges. The attacker can send a specially crafted HTTP request to trigger this.
Originally disclosed on Cisco Talos
An OS command injection vulnerability exists in the web interface mac2name functionality of Peplink Smart Reader v1.2.0 (in QEMU). A specially crafted HTTP request can lead to arbitrary 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
The mac parameter is inserted into a shell command without validation or escaping, allowing command injection.
Impact
An authenticated attacker can execute arbitrary commands with root privileges, leading to full compromise of the device.
What the attacker needed
Authentication to the web interface
The fix
The vendor released new firmware versions that address the vulnerability.
How it was found
- Authenticate to the web interface.
- Send a POST request to /cgi-bin/api.cgi with parameters option=xws, type=json, mode=info, func=mac2name, and a malicious mac value.
- The device constructs and executes a system command containing the unvalidated mac value, leading to arbitrary command execution.
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 is a command injection bug. The device takes a user-supplied value (the MAC address) and uses it to build a system command without checking it. An attacker who can log in can insert extra commands that run with the highest privileges on 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.