Netgear Nighthawk R7000P AWS_JSON Unauthenticated Double Stack Overflow Vulnerability
The aws_json daemon on the Netgear Nighthawk R7000P fetches JSON from a remote server over HTTPS without verifying the certificate, and then copies fields into fixed-size stack buffers using strcpy without bounds checking. An attacker who can redirect the router's DNS or TCP traffic can serve malicious JSON that triggers a stack buffer overflow, leading to pre-authentication remote code execution as root.
Published on hdwsec.fr
Pre-authentication remote code execution vulnerability found in the Netgear Nighthawk R7000P on the WAN interface. Nighthawk R7000P is a popular dual-band WiFi router advertised with gaming-focused features, smart parental controls, and internal hardware that is sufficiently powerful to accommodate the needs of home…
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
The daemon uses strcpy to copy attacker-controlled JSON fields into fixed-size stack buffers without length checks, and curl is invoked with -k so the HTTPS server's certificate is not verified.
Impact
An attacker on the WAN side could execute arbitrary code as root on the router without authentication, potentially leading to access to third-party subnets.
What the attacker needed
Attacker can intercept or redirect router traffic; router fetches JSON from vendor domain on boot; no authentication needed
The fix
The vendor fixed the issue in firmware versions [redacted] and later for the R7000P; the report also recommends removing the -k option from curl and replacing strcpy with bounded functions.
How it was found
- Set up a device in router mode to intercept and modify requests, including a DNS server.
- Configure the DNS server to resolve the vendor's device-location domain to the attacker's address.
- Run a custom HTTPS server that returns malicious JSON when the router sends its GET request.
- Connect the router's WAN port to the attacker device and boot the router.
- Wait for the router to fetch the JSON and trigger the overflow, then obtain a remote shell.
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.
The router runs a small program that downloads some data from a website and copies parts of it into a fixed-size space in memory without checking how long the data is. Because the program also skips checking the website's certificate, anyone who can intercept the connection can send extra-long data that spills over into other memory and lets them run their own commands on the router. This happens before any login, so no password is needed.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.