ASUSWRT URL Processing Stack Buffer Overflow
The ASUS router web interface has a stack buffer overflow when it processes a URL against the XSS blacklist, because the URL length is not bounded. An attacker could use stack pivoting and ROP gadgets to run their own command and obtain a reverse shell.
starlabs.sg
Published on starlabs.sg
While processing the URL for any blacklisted XSS list like the script tag in the checkxssblacklist function, a stack buffer overflow is possible by extending the length of the URL when accessing the web interface of the ASUS Router. To exploit it, stack pivoting technique is used before chaining up ROP gadgets to call…
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 URL is copied into a fixed-size stack buffer without a length check before it is compared against the XSS blacklist.
Impact
An attacker could achieve remote code execution on the router and obtain a reverse shell.
What the attacker needed
Access to the router web interface
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.
A router's web page checks the address you type against a list of dangerous patterns. If the address is very long, it overflows a fixed-size memory area on the router and can overwrite the instructions the router will run next. The author uses that to make the router run a command of their choosing, which connects back to them.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.