\xeb\xfe's Blog.

PHPCMS V9 通行证注册缺陷

2017/12/10

简要描述

通过通行证注册用户,可以直接注册VIP注册会员。

详细说明

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/**
* 添加用户
*/
if ($action == 'member_add') {
$userinfo = array();
$userinfo['phpssouid'] = isset($arr['uid']) ? $arr['uid'] : exit('0');
$userinfo['encrypt'] = isset($arr['random']) ? $arr['random'] : exit('0');
$userinfo['username'] = isset($arr['username']) ? $arr['username'] : exit('0');
$userinfo['password'] = isset($arr['password']) ? $arr['password'] : exit('0');
$userinfo['email'] = isset($arr['email']) ? $arr['email'] : '';
$userinfo['regip'] = isset($arr['regip']) ? $arr['regip'] : '';
$userinfo['regdate'] = $userinfo['lastdate'] = SYS_TIME;
$userinfo['modelid'] = 10;
$userinfo['groupid'] = 6;

$userid = $db->insert($userinfo, 1);
if($userid) {
exit('1');
} else {
exit('0');
}
}

$userinfo数组没有初始化,第16行直接执行了insert操作,我们可以直接post userinfo[vip]=1这样的表单直接覆盖数组。
为什么post表单的值是vip,因为数据库中member表有vip字段,默认值为0(普通会员),1为VIP会员。

漏洞证明

原文链接:PHPCMS V9 通行证注册缺陷

CATALOG
  1. 1. 简要描述
  2. 2. 详细说明
  3. 3. 漏洞证明