(CVE-2021-34979) NETGEAR R6260 mini_httpd Buffer Overflow Unauthenticated Remote Code Execution
A buffer overflow in the router's mini_httpd web server lets an attacker on the local network send an overly long SOAP_LOGIN_TOKEN environment variable to setupwizard.cgi, overwriting the instruction pointer. This allows arbitrary code execution as root.
starlabs.sg
Published on starlabs.sg
This vulnerability allows for an attacker with LAN access to a NETGEAR R6260 router to execute arbitrary code. This was tested on the latest firmware available for the router, V1.1.0.781.0.1 at the point of writing.
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 an unbounded strcat() in check_soap_login_record() copies the SOAP_LOGIN_TOKEN environment variable into a fixed-size buffer without a length check.
Impact
An attacker with LAN access could execute arbitrary code as root on the router.
What the attacker needed
LAN access to the router
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 runs a small web server that passes some request data into a program called setupwizard.cgi. That program copies the data into a fixed-size memory space without checking length, so a very long value spills over and overwrites the place that tells the processor what to run next. An attacker on the same local network can use this to make the router run their own code with the highest privileges.
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.