Skip to content
RCE Advisory Advanced CVE-2021-27256

(Pwn2Own) NETGEAR R7800 apply_save.cgi rc_service Command Injection Remote Code Execution Vulnerability

The apply_save.cgi handler on the NETGEAR R7800 passes the user-supplied rc_service parameter into a system call without validating it. A network-adjacent attacker who bypasses the existing authentication could run arbitrary commands as root.

takeshi Follow

Originally disclosed on Zero Day Initiative

High 8.8 View original

This vulnerability allows network-adjacent attackers to execute arbitrary code on affected installations of NETGEAR R7800. Although authentication is required to exploit this vulnerability, the existing authentication mechanism can be bypassed.

takeshi, on the Zero Day Initiative

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 report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the rc_service parameter is concatenated into a shell command without sanitisation, so shell metacharacters in the value are executed.

Impact

An attacker on the adjacent network could execute arbitrary code as root, though authentication is required and must first be bypassed.

What the attacker needed

Network-adjacent access to the router; authentication bypass first

The fix

NETGEAR issued an update that corrects the vulnerability.

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 report has not been written yet. The Original tab links to the source.

This router has a web page that takes a value from the request and hands it to the operating system to run as a command. Because the value is not checked, someone who can reach the router's network can slip in their own commands. The result is full control of the device as its most powerful user, root.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More from Zero Day Initiative

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.