ASUS RT-AC68U RCE
The ASUS RT-AC68U router firmware contains multiple vulnerabilities, including an unauthenticated file read via SQL injection and an authenticated file write via WebDAV MOVE/COPY, which can be chained to achieve remote code execution. An attacker could also cause denial of service and cross-site scripting.
robertchen.cc
Published on robertchen.cc
Over the summer of my junior year, I decided to do some router pentesting. Embedded security always seemed very fun to me.
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 write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely multiple coding mistakes: an SQL injection check performed before URL decoding, improper path sanitisation in WebDAV COPY/MOVE handlers, an off-by-slash authentication bypass, and missing output encoding in several web pages.
Impact
An attacker could read sensitive files, write arbitrary files, and chain these to achieve remote code execution; denial of service and cross-site scripting are also possible, though some exploits require specific configuration or user interaction.
What the attacker needed
Lighttpd server enabled; Cloud Disk feature enabled; Digital Media Server enabled for SQLi; external device mounted for some exploits
The fix
The vulnerabilities were patched in firmware version 3.0.0.4.386.41634, with specific mitigations such as performing SQL injection checks after URL decoding and sanitising file paths.
How it was found
- Enable the lighttpd server and Cloud Disk feature.
- For the SQL injection, enable Digital Media Server functionality.
- Send crafted PROPFINDMEDIALIST requests to create a fake album with a file path.
- Trigger GETMUSICCLASSIFICATION to retrieve the file contents.
- For file write, create a directory structure under /mnt and send a COPY request with a crafted destination.
- For the off-by-slash bypass, send a COPY request to /RT-AC68U without a trailing slash to copy from /mnt to /.
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 write-up has not been written yet. The Original tab links to the source.
This report describes several security holes in a home router's web interface. One flaw lets an attacker read sensitive files without logging in, and another lets a logged-in attacker write files anywhere, so together they can run malicious code on the device. The router also has bugs that can crash it or inject scripts into web pages.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.