Skip to content
RCE Advisory Advanced CVE-2019-5143

Moxa AWK-3131A iw_console conio_writestr Remote Code Execution Vulnerability

The restricted console on the Moxa AWK-3131A passes the user-supplied time server value into a formatted string function without validating it, so a format string that expands to a large amount of text overflows a stack buffer. An authenticated low-privilege user could overwrite the saved return address and achieve remote code execution.

A member Follow

Originally disclosed on Cisco Talos

High 8.8 View original

An exploitable format string vulnerability exists in the iwconsole coniowritestr functionality of the Moxa AWK-3131A firmware version 1.13. A specially crafted time server entry can cause an overflow of the time server buffer, resulting in remote code execution.

a member, 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 time server value is only length-checked and is then passed as a format string to vsprintf into a fixed-size stack buffer, so format specifiers can expand the output beyond the buffer and overwrite the saved return address.

Impact

An authenticated low-privilege user could corrupt memory and potentially execute code on the device, as shown by a crash where the program counter was overwritten.

What the attacker needed

Valid low-privilege credentials; access to Telnet or SSH on the device

How it was found

  1. Log in to the device over Telnet or SSH as a low-privilege user.
  2. Choose Time Settings and then Time server 1 or Time server 2.
  3. Enter a format string that expands to a large amount of data as the time server value.
  4. Return to the Time Settings menu and open the time server menu again so the stored value is printed.
  5. The oversized output overflows the buffer and corrupts the saved return address, crashing or redirecting execution.

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 has a menu-driven console where you can type in a time server address. That text is later used as a template for building a message, and special characters in the template can make the message much longer than the space reserved for it. The extra text spills over into memory that controls where the program goes next, letting an attacker redirect execution.

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 A member

View all

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