Skip to content
RCE Advisory Intermediate CVE-2023-34356

peplink Surf SOHO HW1 data.cgi xfer_dns OS command injection vulnerability

An authenticated user with write privileges could inject shell metacharacters through the domain parameter of the DNS zone transfer endpoint, because the value was placed into a shell command without proper filtering. This allowed arbitrary commands to run with root privileges on the router.

Matt Wiseman Follow

Originally disclosed on Cisco Talos

High 7.2 View original

An OS command injection vulnerability exists in the data.cgi xferdns functionality of peplink Surf SOHO HW1 v6.3.5 (in QEMU). A specially crafted HTTP request can lead to command execution.

Matt Wiseman, on Cisco Talos

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 domain parameter is inserted into a shell command string without adequate escaping, and the validation only rejects a small set of characters.

Impact

An authenticated attacker with write privileges could execute arbitrary commands as root on the device.

What the attacker needed

Authenticated user with write privileges

How it was found

  1. Authenticate to the device web interface as a user with write privileges.
  2. Send an HTTP POST request to the data.cgi endpoint with option set to xfer_dns and step set to view_domain.
  3. Supply a crafted domain parameter that escapes the intended command.
  4. The command executes with root privileges.

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.

The router's web admin page builds a system command using text supplied by the user. It only blocks a few special characters, so other characters can break out of the intended command and run extra commands as the administrator. The attacker must already be logged in with write access.

What is RCE?

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

More by Matt Wiseman

View all

73 more disclosed reports, best first.

More from Cisco Talos

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.