[UNIX] Remote Execution of Commands in oMail Webmail

From: SecuriTeam (support_at_securiteam.com)
Date: 08/24/03

  • Next message: SecuriTeam: "[UNIX] OpenSLP Initscript Symlink Vulnerability"
    To: list@securiteam.com
    Date: 24 Aug 2003 18:05:57 +0200
    
    

    The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com
    - - promotion

    The SecuriTeam alerts list - Free, Accurate, Independent.

    Get your security news from a reliable source.
    http://www.securiteam.com/mailinglist.html

    - - - - - - - - -

      Remote Execution of Commands in oMail Webmail
    ------------------------------------------------------------------------

    SUMMARY

     <http://webmail.omnis.ch/omail.pl?action=about> oMail-webmail is "a
    Webmail solution for mail server based on qmail and optionaly vmailmgr or
    vpopmail". There is a security flaw in oMail that, if installed by
    default, allows for remote root access. The minimum risk is exposure of
    sensitive information (all email accessible to omail), as well as remote
    execution of commands as a non-privileged user.

    DETAILS

    Vulnerable systems:
     * oMail Webmail version 0.98.4 and earlier

    The flaw occurs in the function checklogin();
    ........
    omail.pl, line 689:
        my $command = 'echo -e "'. $domainname .'\000'. $username
    '\000'.$password .'\000" | ' .$vauthenticate;

        my $output = `$command`;
    ........

    Prior to calling this line, the variables $domainname, $username, and
    $password are not filtered for shell metacharacters, which results in the
    possibility of the execution of arbitrary commands.

    Vendor status:
    The author was contacted two weeks ago, but did not respond.

    Patch:
    The patch in itself is quite simple:
    --- omail-webmail-0.98.4/omail-old.pl 2001-08-26
    08:35:27.000000000 -0400
    +++ omail-webmail-0.98.4/omail.pl 2003-07-28

    12:29:36.000000000 -0400
    @@ -396,7 +396,7 @@

     if (($vmailmgr || $vpopmail) && $cgi_mode eq "suid") {
    - if (!($userid =~ /(.*)\@(.*)/)) {
    + if (!($userid =~ /([A-Z,a-z,0-9]*)\@([\w\.]*)$/)) {
     omailerror("domain name is missing : format userid\@domain");
     } else {
     $userid = $1;

    @@ -406,7 +406,7 @@
     my $password = param("password");
    - $password =~ /^(.+)$/;
    + $password =~ /^([^\"]+)$/;
     $password = $1;

     # 8 possible cases :

    ADDITIONAL INFORMATION

    The information has been provided by <mailto:pwhelan@bunkerchile.net>
    Phillip Whelan.

    ========================================

    This bulletin is sent to members of the SecuriTeam mailing list.
    To unsubscribe from the list, send mail with an empty subject line and body to: list-unsubscribe@securiteam.com
    In order to subscribe to the mailing list, simply forward this email to: list-subscribe@securiteam.com

    ====================
    ====================

    DISCLAIMER:
    The information in this bulletin is provided "AS IS" without warranty of any kind.
    In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages.


  • Next message: SecuriTeam: "[UNIX] OpenSLP Initscript Symlink Vulnerability"

    Relevant Pages