当前位置:WooYun >> 漏洞信息

漏洞概要 关注数(24) 关注此漏洞

缺陷编号:wooyun-2015-0100199

漏洞标题:ourphp没设计缺陷可浏览他人的站内信

相关厂商:ourphp.net

漏洞作者: 浅蓝

提交时间:2015-03-24 14:01

修复时间:2015-06-22 14:06

公开时间:2015-06-22 14:06

漏洞类型:非授权访问/权限绕过

危害等级:中

自评Rank:10

漏洞状态:厂商已经确认

漏洞来源: http://www.wooyun.org,如有疑问或需要帮助请联系 [email protected]

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2015-03-24: 细节已通知厂商并且等待厂商处理中
2015-03-24: 厂商已经确认,细节仅向厂商公开
2015-03-27: 细节向第三方安全合作伙伴开放
2015-05-18: 细节向核心白帽子及相关领域专家公开
2015-05-28: 细节向普通白帽子公开
2015-06-07: 细节向实习白帽子公开
2015-06-22: 细节向公众公开

简要描述:

rt

详细说明:

ourphp.net官网
共有三个帐号测试

[email protected]
[email protected]
[email protected]


[email protected][email protected]发一个站内信 站内信的ID为1
再用[email protected][email protected]发一个站内信 站内信的ID为2
接着登录[email protected]
访问http://localhost/client/user/ourphp_mail.php?id=1

NS4DVZ7KQ~JBMX2OEU9__PR.png


再访问http://localhost/client/user/ourphp_mail.php?id=2

}~PE1{5Q5}QM3FSH%6E`ETC.png


[email protected][email protected]发的站内信我们也可以看。 看一下代码

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
</head>
<body>
<?php
/*
* Ourphp - CMS建站系统
* Copyright (C) 2014 ourphp.net
* 开发者:哈尔滨伟成科技有限公司
*/
include '../../config/ourphp_code.php';
include '../../config/ourphp_config.php';
include '../../config/ourphp_version.php';
include '../../config/ourphp_Language.php';
include '../../function/ourphp_function.class.php';
$id = intval($_GET['id']);
session_start();
if(!isset($_SESSION['username'])){
exit("no!");
}
$sql="select OP_Usersend,OP_Usercollect,OP_Usercontent,time from `ourphp_usermessage` where id = ".$id;
$query=mysql_query($sql);
$ourphp_rs=mysql_fetch_array($query)
?>
<table width="90%" border="0" cellpadding="10" style="font-size:12px;">
<tr>
<td width="150"><div align="right">发件人:</div></td>
<td>&nbsp;<?php if($ourphp_rs[0] == $_SESSION['username']){ echo '我';}else{ echo $ourphp_rs[0];} ?></td>
</tr>
<tr>
<td><div align="right">收件人:</div></td>
<td>&nbsp;<?php echo $ourphp_rs[1]; ?></td>
</tr>
<tr>
<td valign="top"><div align="right">收件内容:</div></td>
<td>&nbsp;<?php echo $ourphp_rs[2]; ?></td>
</tr>
<tr>
<td><div align="right">时间:</div></td>
<td>&nbsp;<?php echo $ourphp_rs[3]; ?></td>
</tr>
</table>
<?php
mysql_free_result($query);
?>
</body>
</html>


没有进行任何限制 直接读数据

漏洞证明:

共有三个帐号测试

[email protected]
[email protected]
[email protected]


[email protected][email protected]发一个站内信 站内信的ID为1
再用[email protected][email protected]发一个站内信 站内信的ID为2
接着登录[email protected]
访问http://localhost/client/user/ourphp_mail.php?id=1

NS4DVZ7KQ~JBMX2OEU9__PR.png


再访问http://localhost/client/user/ourphp_mail.php?id=2

}~PE1{5Q5}QM3FSH%6E`ETC.png


[email protected][email protected]发的站内信我们也可以看。 看一下代码
client/user/ourphp_mail.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
</head>
<body>
<?php
/*
* Ourphp - CMS建站系统
* Copyright (C) 2014 ourphp.net
* 开发者:哈尔滨伟成科技有限公司
*/
include '../../config/ourphp_code.php';
include '../../config/ourphp_config.php';
include '../../config/ourphp_version.php';
include '../../config/ourphp_Language.php';
include '../../function/ourphp_function.class.php';
$id = intval($_GET['id']);
session_start();
if(!isset($_SESSION['username'])){
exit("no!");
}
$sql="select OP_Usersend,OP_Usercollect,OP_Usercontent,time from `ourphp_usermessage` where id = ".$id;
$query=mysql_query($sql);
$ourphp_rs=mysql_fetch_array($query)
?>
<table width="90%" border="0" cellpadding="10" style="font-size:12px;">
<tr>
<td width="150"><div align="right">发件人:</div></td>
<td>&nbsp;<?php if($ourphp_rs[0] == $_SESSION['username']){ echo '我';}else{ echo $ourphp_rs[0];} ?></td>
</tr>
<tr>
<td><div align="right">收件人:</div></td>
<td>&nbsp;<?php echo $ourphp_rs[1]; ?></td>
</tr>
<tr>
<td valign="top"><div align="right">收件内容:</div></td>
<td>&nbsp;<?php echo $ourphp_rs[2]; ?></td>
</tr>
<tr>
<td><div align="right">时间:</div></td>
<td>&nbsp;<?php echo $ourphp_rs[3]; ?></td>
</tr>
</table>
<?php
mysql_free_result($query);
?>
</body>
</html>


没有进行任何限制 直接读数据

修复方案:

给client/user/ourphp_mail.php中输出数据的地方加上以下代码

if($_SESSION['username']==$ourphp_rs[0]||$_SESSION['username']==$ourphp_rs[1]){
输出数据库内容那部分代码
}else{
echo '非法访问';
}


意思是 如果用户名与发件人相同 或者 用户名与收件人相同即可浏览站内信
否则输出"非法访问"

版权声明:转载请注明来源 浅蓝@乌云


漏洞回应

厂商回应:

危害等级:中

漏洞Rank:5

确认时间:2015-03-24 14:05

厂商回复:

我们会在V1.2.0版本中修复这个问题。谢谢您的帮助。

最新状态:

暂无