Skip to content
RCE Write-up Intermediate

[Blog] CVE-2015-2079: Arbitrary Command Execution in Usermin

An authenticated Usermin user could set a signature file path that, due to Perl's two-argument open() interpreting pipe characters, executed arbitrary shell commands when composing or editing an email. This allowed command execution as the web server user, though file permissions still applied.

code-white.com

Published on code-white.com

While performing a penetration test for a customer, I stumbled across a command execution vulnerability in Usermin that is pretty trivial to identify and to exploit. The interesting part is that this vulnerability survived for almost 13 years.

The author, on code-white.com

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 write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The application passed user-controlled input to Perl's two-argument open() without validation, allowing pipe characters to trigger command execution.

Impact

An authenticated user could execute arbitrary shell commands as the web server user, though normal Unix file permissions still applied and critical files like /etc/shadow could not be read.

What the attacker needed

Authenticated Usermin user account

The fix

The vulnerability was fixed in Usermin 1.660 by replacing Perl's built-in open() with Webmin's custom open_readfile() function, which prepends the path with '<' to force read mode.

How it was found

  1. Log in to Usermin as a regular user.
  2. Send a POST request to /uconfig_save.cgi with the signature file option set to a value containing a shell command enclosed in pipes.
  3. Request /mailbox/reply_mail.cgi or /mailbox/edit_sig.cgi to trigger the command and see its output.

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 write-up has not been written yet. The Original tab links to the source.

Usermin is a web tool that lets people read email and change some settings on a server. A logged-in user could type a special filename that the server treated as a command to run, so the server ran that command and showed the output. This happened because the programming language used (Perl) has a file-opening feature that can also start other programs if the filename contains a pipe symbol.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

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.