IoT Security Flaws: What I Learned From Hacking My First Router
The router's admin panel was vulnerable to cross-site request forgery (CSRF) on its factory reset and password reset functions, allowing an attacker to trigger a factory reset or change the admin password without the user's consent. An attacker could wipe the router or take control of it by tricking a logged-in user into visiting a malicious webpage.
medium.com
Published on medium.com
My name is Brenton McPherson, and I’m an aspiring security researcher currently studying at Maryville University. I’m brand new to IoT hacking and wanted to give it a try.
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 the router's admin panel did not use CSRF tokens or other protections to verify that state-changing requests originated from its own interface.
What the attacker needed
Victim is logged into the router admin panel; victim visits a malicious webpage; attacker can host a webpage
How it was found
- Take the router apart and connect to serial ports to dump the firmware.
- Inspect the firmware and notice references to do_cmd, then examine the admin panel.
- Observe that login attempts send a GET request with username and password in the URL.
- Craft an HTML payload that triggers a factory reset when loaded by a logged-in user.
- Intercept the password reset request and note it sends the same parameters in a POST body.
- Create a form-based HTML payload that changes the router's password when visited by a logged-in user.
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 router's admin panel did not check that requests to reset the router or change its password actually came from the router's own pages. An attacker could make a webpage that, when opened by someone already logged into the router, silently sends those commands. The person's router could be wiped or taken over without them doing anything.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.