Skip to content
RCE Write-up Advanced

The first step to PWN2OWN - A sad one

The UPnP service on the NETGEAR RAX30 router passed the SOAPACTION header value into a shell command without sanitising it, so a crafted request could run arbitrary commands. An attacker on the LAN could therefore execute commands on the device.

Vương Quốc Huy Follow

Published on blog.viettelcybersecurity.com

When I was taking a look at the UPnP binary of NETGEAR RAX30 for PWN2OWN Toronto 2022, I found a command injection vulnerability on the LAN side. This is the first vulnerability that I have ever found, but it is a die young one.

Vương Quốc Huy, on blog.viettelcybersecurity.com

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 action name parsed from the SOAPACTION header was concatenated into a logger command and passed to system() without sanitisation.

Impact

An attacker on the LAN could execute arbitrary commands on the router; the text notes the issue was patched before the contest began.

What the attacker needed

Access to the LAN; WAN port connected so UPnP runs

The fix

The vulnerable system() call was replaced with a dedicated logging function, which was fixed before the contest.

How it was found

  1. Send an M-SEARCH request over SSDP to discover the UPnP service details.
  2. Use the returned service information to craft a POST request with a malicious SOAPACTION header.
  3. Send the request to the UPnP service on port 56688 to trigger the command injection.

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 helper service that lets devices on the local network ask it to do things. That service took a piece of text from an incoming request and glued it into a command it ran on the device, without checking the text first. Because of that, someone on the same network could make the router run commands of their choosing.

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 Netgear

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.