### 简要描述: 74CMS存在设计缺陷,导致可重置任意用户密码 ### 详细说明: 文件/user/user_getpass.php ``` //找回密码第2步 elseif ($act=='get_pass') { $captcha=get_cache('captcha'); $postcaptcha = trim($_POST['postcaptcha']); if($captcha['verify_getpwd']=='1' && empty($postcaptcha)) { showmsg("请填写验证码",1); } if ($captcha['verify_getpwd']=='1' && strcasecmp($_SESSION['imageCaptcha_content'],$postcaptcha)!=0) { showmsg("验证码错误",1); } $postusername=trim($_POST['username'])?trim($_POST['username']):showmsg('请输入用户名!',1); if (empty($_POST['email']) || !preg_match("/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/",$_POST['email'])) { showmsg('电子邮箱格式错误!',1); } require_once(QISHI_ROOT_PATH.'include/fun_user.php'); $userinfo=get_user_inusername($postusername); if (empty($userinfo) || $userinfo['email']<>$_POST['email']) { showmsg('用户名或注册邮箱填写错误',1); } else { $mailconfig=get_cache('mailconfig'); $arr['username']=$userinfo['username']; $arr['password']=rand(100000,999999); if...
### 简要描述: 74CMS存在设计缺陷,导致可重置任意用户密码 ### 详细说明: 文件/user/user_getpass.php ``` //找回密码第2步 elseif ($act=='get_pass') { $captcha=get_cache('captcha'); $postcaptcha = trim($_POST['postcaptcha']); if($captcha['verify_getpwd']=='1' && empty($postcaptcha)) { showmsg("请填写验证码",1); } if ($captcha['verify_getpwd']=='1' && strcasecmp($_SESSION['imageCaptcha_content'],$postcaptcha)!=0) { showmsg("验证码错误",1); } $postusername=trim($_POST['username'])?trim($_POST['username']):showmsg('请输入用户名!',1); if (empty($_POST['email']) || !preg_match("/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/",$_POST['email'])) { showmsg('电子邮箱格式错误!',1); } require_once(QISHI_ROOT_PATH.'include/fun_user.php'); $userinfo=get_user_inusername($postusername); if (empty($userinfo) || $userinfo['email']<>$_POST['email']) { showmsg('用户名或注册邮箱填写错误',1); } else { $mailconfig=get_cache('mailconfig'); $arr['username']=$userinfo['username']; $arr['password']=rand(100000,999999); if (smtp_mail($userinfo['email'],"找回密码","您的新密码为:".$arr['password'])) { $md5password=md5(md5($arr['password']).$userinfo['pwd_hash'].$QS_pwdhash); if (!$db->query( "UPDATE ".table('members')." SET password = '$md5password' WHERE uid='{$userinfo['uid']}'")) { showmsg('密码修改失败',1); } $smarty->assign('step',"2"); $smarty->assign('email',$userinfo['email']); $smarty->assign('title','找回密码 - '.$_CFG['site_name']); $smarty->display('user/getpass.htm'); } else { showmsg('邮件发送失败,请联系网站管理员',0); } } } ``` 当输入用户名和email之后就会发送新密码到email 然后新密码是6位纯数字: $arr['password']=rand(100000,999999); 所以导致在知道用户名和email的情况下课爆破处用户的新密码。 再者就是,对于用户名和email,因为这是人才系统,在用户简历中存在用户名和email信息 只要注册企业用户就能看到用户的用户名和email等信息,为重置密码提供便捷。如图: [<img src="https://images.seebug.org/upload/201405/08150456a3b3346943771156754d26983ab185d1.png" alt="1.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201405/08150456a3b3346943771156754d26983ab185d1.png) 最后就是剩下的,来爆破重置之后的密码了,因为此系统安装后默认是不开启登陆验证码的,就算开启验证码我们也可以进行爆破。 接口:http://localhost/74cms/wap/wap_login.php [<img src="https://images.seebug.org/upload/201405/08151340c40b6b344ce7da1519d1b209206e5f23.png" alt="2.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201405/08151340c40b6b344ce7da1519d1b209206e5f23.png) ### 漏洞证明: 找回用户111111的密码: [<img src="https://images.seebug.org/upload/201405/081514046bde05547af6413e6097ff36fbd515b7.png" alt="3.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201405/081514046bde05547af6413e6097ff36fbd515b7.png) 然后来爆破密码: [<img src="https://images.seebug.org/upload/201405/0815465252cb946c6a9a66d9a7b92b2336e42227.png" alt="4.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201405/0815465252cb946c6a9a66d9a7b92b2336e42227.png) 成功得到用户新密码