Skip to content
Memory corruption Write-up Advanced

(CVE-2021-34978) NETGEAR R6260 setupwizard.cgi Buffer Overflow Unauthenticated Remote Code Execution

A buffer overflow in the setupwizard.cgi component of the NETGEAR R6260 router can be triggered by a crafted SOAP request, allowing an attacker with LAN access to execute arbitrary code. The flaw arises from unterminated strings produced by strncpy() and a subsequent sprintf() call that overlaps buffers, giving control of the instruction pointer.

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 author, on starlabs.sg

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 code uses strncpy() without ensuring null termination and then sprintf() into an overlapping buffer, causing a buffer overflow.

Impact

An attacker with LAN access could execute arbitrary code on the router, potentially taking full control of the device.

What the attacker needed

LAN access to the router; router runs vulnerable firmware

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 is a memory corruption bug in a home router's web interface. When the router processes a specially formatted request, it mishandles text strings in memory, which can overwrite the part of memory that controls what code the router runs next. An attacker on the same local network could then make the router run their own code.

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.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.