Gregarius RSS聚合器下ajax.php文件SQL注入漏洞

来源:岁月联盟 编辑:zhuzhu 时间:2009-03-25
Gregarius RSS聚合器下ajax.php文件SQL注入漏洞 受影响系统:
Marco Bonetti Gregarius <= 0.5.4

描述:
Gregarius是基于php的RSS聚合器,可以将所设定的源聚合在一起,以HTML或者XML方式输出。

Gregarius的/ajax.php文件中存在多个SQL注入漏洞,允许远程安全者无需认证便可获得管理凭据。以下是有漏洞的代码段:

function __exp__getFeedContent($cid) {
    ob_start();
    rss_require(’cls/items.php’);
    
    $readItems = new ItemList();

    $readItems -> populate(" not(i.unread & ". RSS_MODE_UNREAD_STATE  .")
    and i.cid= $cid", "", 0, 2, ITEM_SORT_HINT_READ);
    $readItems -> setTitle(LBL_H2_RECENT_ITEMS);
    $readItems -> setRenderOptions(IL_TITLE_NO_ESCAPE);
    foreach ($readItems -> feeds[0] -> items as $item) {
        $item -> render();
    }
    $c = ob_get_contents();
    
    ob_end_clean();
    return "$cid|@|$c";
}

sajax_handle_client_request()调用上面的函数并允许安全者通过rsargs[]数组指定$cid的内容,因此无论magic_quotes_gps设置如何都可以影响查询。

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