Moxa AWK-3131A iw_webs DecryptScriptFile file name Command Injection Vulnerability
The diagnostic script file name in the iw_webs functionality is passed unescaped into a system call, so a low-privilege authenticated user can inject shell commands. This gives remote control over the device.
An exploitable command injection vulnerability exists in the iwwebs functionality of the Moxa AWK-3131A firmware version 1.13. A specially crafted diagnostic script file name can cause user input to be reflected in a subsequent iwsystem call, resulting in remote control over the device.
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 file name is inserted into a shell command string passed to iw_system without escaping or filtering special characters.
Impact
An authenticated low-privilege attacker could execute arbitrary commands on the device, gaining full control of confidentiality, integrity and availability.
What the attacker needed
Authenticated low-privilege account; access to the diagnostic script upload
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 runs a command-line program to decrypt a diagnostic script, and it builds that command by pasting in the file name the user supplied. Because special characters in the name are not neutralised, the device ends up running extra commands the attacker wrote. Anyone logged in with even a low-privilege account can use this to take over the appliance.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.