Peplink Smart Reader /bin/login privilege escalation vulnerability
The custom /bin/login binary on Peplink Smart Reader v1.2.0 contains hard-coded credentials for several accounts, including an 'iot' account that launches a restricted busybox shell. An attacker with serial console access can log in as 'iot' and use the busybox 'exec' builtin to escape the restricted shell and obtain a root shell.
Originally disclosed on Cisco Talos
A privilege escalation vulnerability exists in the /bin/login functionality of Peplink Smart Reader v1.2.0 (in QEMU). A specially crafted command line argument can lead to a limited-shell escape and elevated capabilities.
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 custom /bin/login uses hard-coded credentials and launches a restricted busybox shell that fails to disable the 'exec' builtin, allowing escape to an unrestricted shell.
Impact
An attacker with physical access to the serial console could gain a root shell, leading to full compromise of the device.
What the attacker needed
Physical access to serial console
The fix
The vendor released new firmware versions that address the vulnerability.
How it was found
- Connect to the device's serial console.
- Authenticate as the 'iot' user using the hard-coded credentials.
- At the restricted shell prompt, run the exec command to start /bin/sh.
- Obtain an unrestricted root shell.
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 device's login program has secret built-in usernames and passwords. One of these accounts starts a limited command shell that is supposed to restrict what you can do, but it forgets to block a built-in command called 'exec' that lets you start any other program. By using that command, someone with physical access to the device's serial port can get full control as the root user.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.