Skip to content
RCE Advisory Intermediate CVE-2019-5138

Moxa AWK-3131A Encrypted Diagnostic Script Command Injection Vulnerability

An encrypted diagnostic script file can contain arbitrary busybox commands that are executed as root when uploaded by a low-privilege authenticated user. An attacker could gain remote control over the device.

Carl Hurd Follow

Originally disclosed on Cisco Talos

Critical 9.9 View original

An exploitable command injection vulnerability exists in encrypted diagnostic script functionality of the Moxa AWK-3131A firmware version 1.13. A specially crafted diagnostic script file can cause arbitrary busybox commands to be executed, resulting in remote control over the device.

Carl Hurd and Jared Rittle, 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 diagnostic script format allows arbitrary command arguments and the device executes them as root without validating or restricting the commands.

Impact

An authenticated low-privilege user could execute arbitrary commands as root, leading to full remote control of the device.

What the attacker needed

Authenticated as a low-privilege user; ability to upload a file to the web portal

How it was found

  1. Create a diagnostic script file with the required magic header and a loop definition.
  2. Include a command line that uses a permitted command with arguments to run an arbitrary action.
  3. Encrypt the script file using the hardcoded password.
  4. Upload the encrypted file to the web portal's advanced diagnostics feature while authenticated as a low-privilege user.

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 device lets users upload a diagnostic script file to run some network commands. The script is encrypted with a hardcoded password, so anyone can create a valid file. The device runs the commands in the file as the root user without checking what they are, so an attacker can run any command and take over the device.

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 Carl Hurd

View all

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