Skip to content
RCE Advisory Intermediate CVE-2023-22365

Milesight UR32L ys_thirdparty check_system_user OS command injection vulnerability

The router's user permission command passes a username to a shell script without sanitising it, allowing an authenticated attacker to inject OS commands. An attacker with admin credentials could execute arbitrary commands as a privileged user, such as rebooting the device.

Francesco Benvenuto Follow

Originally disclosed on Cisco Talos

High 7.2 View original

An OS command injection vulnerability exists in the ysthirdparty checksystemuser functionality of Milesight UR32L v32.3.0.5. A specially crafted set of network packets 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

The username input is passed directly into a shell command via snprintf and popen without any sanitisation or validation.

Impact

An authenticated attacker with admin privileges could execute arbitrary commands as a privileged user, potentially rebooting the device or causing other damage.

What the attacker needed

Admin credentials for the router console; network access to telnet or SSH service

The fix

The username should be validated and sanitised before being passed to the shell script, or the script should be invoked without a shell.

How it was found

  1. Log in to the router console via telnet or SSH with admin credentials.
  2. Enter enable mode.
  3. Enter configuration mode with 'configure terminal'.
  4. Enter the user_permission menu.
  5. Issue the 'user' command with a username containing shell metacharacters and a command to execute.

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 command-line interface where an admin can manage users. When you type a username, the router runs a system script with that name without checking for special characters. An attacker who can log in as admin can type a username that includes extra commands, and the router will run them with high 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 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.