首页 -> 安全研究

安全研究

安全漏洞
Advanced Electron Forum preg_replace调用远程代码执行漏洞

发布日期:2008-09-20
更新日期:2008-09-23

受影响系统:
Electron Advanced Electron Forum <= 1.0.6
描述:
BUGTRAQ  ID: 31268

Advanced Electron Forum是用PHP编写的在线论坛系统。

Advanced Electron Forum论坛没有安全地调用带有e修饰符的preg_replace()方式:

//Email Links
if($globals['bbc_email']){

    $text = preg_replace(
                array("/\[email=(.*?)\](.*?)\[\/email\]/ies",
                        "/\[email\](.*?)\[\/email\]/ies"),
                array('check_email("$1", "$2")',
                        'check_email("$1", "$1")'), $text);

}

上面的例子使用通配符匹配收集发送给替换参数的匹配,如果用户在[email]标签中使用了复杂的变量句法的话就可以执行任意php代码。

<*来源:James Bercegay (security@gulftech.org
  
  链接:http://secunia.com/advisories/31978/
        http://marc.info/?l=bugtraq&m=122192244101754&w=2
*>

测试方法:

警 告

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

[email]{${phpinfo()}}[/email]

建议:
厂商补丁:

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

http://www.anelectron.com/download.php

浏览次数:2253
严重程度:0(网友投票)
本安全漏洞由绿盟科技翻译整理,版权所有,未经许可,不得转载
绿盟科技给您安全的保障