Home    |    View Topics    |    Search    |    Contact Us    |   



Category:   Application (Security)  >   SquirrelMail S/MIME Plugin Vendors:   SquirrelMail Development Team
SquirrelMail S/MIME Plugin Lets Remote Authenticated Users Execute Arbitrary Commands
SecurityTracker Alert ID:  1013101
SecurityTracker URL:
CVE Reference:   GENERIC-MAP-NOMATCH   (Links to External Site)
Date:  Feb 7 2005
Impact:   Execution of arbitrary code via network, User access via network
Fix Available:  Yes  Vendor Confirmed:  Yes  
Version(s): prior to 0.6
Description:   iDEFENSE reported a vulnerability in the SquirrelMail S/MIME plugin. A remote authenticated user can execute arbitrary commands on the target system.

The 'viewcert.php' script does not properly validate user-supplied data in the 'cert' parameter before passing the data to an exec() call. A remote authenticated webmail user can supply a specially crafted value to execute operating system commands on the target system.

The vendor was notified on September 22, 2004.

The original advisory is available at:

Impact:   A remote user can execute arbitrary commands on the target system with the privileges of the target web service.
Solution:   The vendor has released a fixed version (0.6), available at:

Vendor URL: (Links to External Site)
Cause:   Input validation error
Underlying OS:  Linux (Any), UNIX (Any)

Message History:   None.

 Source Message Contents

Subject:  iDEFENSE Security Advisory 02.07.05: SquirrelMail S/MIME Plugin

SquirrelMail S/MIME Plugin Command Injection Vulnerability

iDEFENSE Security Advisory 02.07.05
February 07, 2005


Squirrelmail S/MIME plugin enables the viewing of S/MIME-signed messages
of the MIME "multipart/signed" format. More information about the plugin
is available at:


Remote exploitation of a command injection vulnerability in the
Squirrelmail S/MIME plugin allows web mail users to execute arbitrary
commands with the privileges of the web server.

The problem specifically exists due to insufficient filtering of
user-provided data in a call to exec(). The following snippet exposes
the offending area of code from viewcert.php:

    if(!isset($cert)) $cert=$_GET['cert'];
    function x509_open($cert) {
        global $cert_in_dir, $openssl;
        $lines = array();
        exec("$openssl x509 -in $cert_in_dir$cert -subject -issuer \
            -dates -serial -fingerprint -noout 2>/tmp/err", $lines);
    list ($ow, $is, $nb, $na, $sn, $fp) = x509_open($cert);

The variable '$cert' from the above snippet contains unfiltered user
supplied data and can be exploited.


Successful exploitation allows authenticated web mail users to execute
arbitrary commands on the underlying system with the privileges of the
web server. This can lead to further compromise and exposure of other
users' mail to the attacker.


iDEFENSE has confirmed the existence of this vulnerability in S/MIME
plugin 0.5 and 0.4. Earlier versions are also suspected to be


PHP provides the escapeshellarg() routine to filter data to be used as
an argument to calls such as exec() and system(). Modify the call to
exec() from:

    exec("$openssl x509 -in $cert_in_dir$cert -subject -issuer -dates \
        -serial -fingerprint -noout 2>/tmp/err", $lines);


    $filtered = escapeshellarg("$cert_in_dir$cert");
    exec("$openssl x509 -in $filtered -subject -issuer -dates -serial \
        -fingerprint -noout 2>/tmp/err", $lines);


The vendor has released S/MIME plugin 0.6 to address this vulnerability.
The plugin is available for download at:


A Mitre Corp. Common Vulnerabilities and Exposures (CVE) number has not
been assigned yet.


09/22/2004  Initial vendor notification
09/22/2004  Initial vendor response
02/07/2005  Coordinated public disclosure


Karol Wiesek is credited with this discovery.

Get paid for vulnerability research


Copyright (c) 2005 iDEFENSE, Inc.

Permission is granted for the redistribution of this alert
electronically. It may not be edited in any way without the express
written consent of iDEFENSE. If you wish to reprint the whole or any
part of this alert in any other medium other than electronically, please
email for permission.

Disclaimer: The information in the advisory is believed to be accurate
at the time of publishing based on currently available information. Use
of the information constitutes acceptance for use in an AS IS condition.
There are no warranties with regard to this information. Neither the
author nor the publisher accepts any liability for any direct, indirect,
or consequential loss or damage arising from use of, or reliance on,
this information.

Go to the Top of This SecurityTracker Archive Page

Home   |    View Topics   |    Search   |    Contact Us

This web site uses cookies for web analytics. Learn More

Copyright 2022, LLC