Skip to content
RCE Advisory Intermediate CVE-2023-22371

Milesight MilesightVPN liburvpn.so create_private_key OS command injection vulnerability

The device authentication API passes the device serial number into a shell command that generates an RSA key, without sanitising it. An attacker who knows the server's authorisation code could inject shell commands and run them on the VPN server.

Francesco Benvenuto Follow

Originally disclosed on Cisco Talos

High 8.1 View original

An os command injection vulnerability exists in the liburvpn.so createprivatekey functionality of Milesight VPN v2.0.2. A specially-crafted network request can lead to command execution.

Francesco Benvenuto, 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 serial number from the request is concatenated into a shell command string passed to system() without validation or escaping.

Impact

An attacker who knows the server's authorisation code could execute arbitrary commands on the VPN server, and that code can be obtained through a separate vulnerability (TALOS-2023-1702).

What the attacker needed

Knowledge of the server authcode; network access to the /Device_Auth API

How it was found

  1. Send a POST request to the /Device_Auth API with the four expected fields, including a valid authcode.
  2. Supply a serial number that is not the all-zero placeholder so the key generation path is reached.
  3. The server checks whether a private key file already exists for that serial number.
  4. If it does not exist, the server builds an openssl command containing the serial number and runs it through the 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 report has not been written yet. The Original tab links to the source.

The VPN server builds a text command to create a key file and puts the device's serial number straight into that text. If the serial number contains extra shell instructions, the computer runs them too. This is called command injection: user input ends up being treated as part of a system command.

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 Francesco Benvenuto

View all

152 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.