Skip to content
RCE Advisory Intermediate CVE-2023-35194CVE-2023-35193

peplink Surf SOHO HW1 api.cgi cmd.mvpn.x509.write OS command injection vulnerability

The router's certificate configuration endpoint builds shell commands from the cert and key request parameters without escaping them, while only the password parameter is escaped. An authenticated user with write privileges could inject extra shell commands that run as root on the device.

Matt Wiseman Follow

Originally disclosed on Cisco Talos

High 7.2 View original

An OS command injection vulnerability exists in the api.cgi cmd.mvpn.x509.write 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

The cert and key parameters are inserted into a shell command string without escaping, while only the pw parameter is passed through an escape routine.

Impact

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

What the attacker needed

Authenticated admin 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 api.cgi endpoint with the func parameter set to cmd.mvpn.x509.write.
  3. Include cert, key and pw parameters, with shell metacharacters in cert or key to break out of the intended command.

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 admin page for uploading certificates. When you submit a certificate, the device runs a small helper program on the command line using the text you supplied. Because two of those text fields are pasted into the command without being cleaned, someone who can log in as an admin can add their own shell commands, and the device runs them with the highest privileges.

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.