### 简要描述: 本来不算提交的,不过我觉得厂商还没有意识到问题的严重性。所以再次发一个详细说明一下。 ### 详细说明: 问题发生在 bbs模块 和上次的类型是一样的 用了model的create方法。 \bbs\controller\index.class.php 行147 ``` /* * 前台 * 帖子发布保存 * */ public function savePost() { $_Obj = M("bbs_thread"); $msgObj = new Msg (); $_Obj->create(); $_Obj->subject = $_POST['info']['subject']; $_Obj->content = $_POST['info']['content']; $_Obj->addtime = time(); if (empty($_Obj->subject) || empty($_Obj->content)) { $msgObj->addMsg ( 'error', Config::lang("TITLEANDCONTENTNOTEMPTY") ); } if (empty($_COOKIE['userId'])) { $msgObj->addMsg ( 'error', Config::lang("BBSPOSTMUSTLOGIN") ); } if (empty($_POST['info']['boardid'])) { $msgObj->addMsg ( 'error', '请选择版块'); } if (! $msgObj->hasMsg) { $user = get('user',$_COOKIE['userId']); $_Obj->uid = $_COOKIE['userId']; $_Obj->username = empty($user->username) ? "Unknow" :$user->username; $_Obj->guestip = NetUtil::getIp(); $_Obj->yz = 1; $_Obj->saveOrUpdate(); // $user->money += 10 ; $user->update();...
### 简要描述: 本来不算提交的,不过我觉得厂商还没有意识到问题的严重性。所以再次发一个详细说明一下。 ### 详细说明: 问题发生在 bbs模块 和上次的类型是一样的 用了model的create方法。 \bbs\controller\index.class.php 行147 ``` /* * 前台 * 帖子发布保存 * */ public function savePost() { $_Obj = M("bbs_thread"); $msgObj = new Msg (); $_Obj->create(); $_Obj->subject = $_POST['info']['subject']; $_Obj->content = $_POST['info']['content']; $_Obj->addtime = time(); if (empty($_Obj->subject) || empty($_Obj->content)) { $msgObj->addMsg ( 'error', Config::lang("TITLEANDCONTENTNOTEMPTY") ); } if (empty($_COOKIE['userId'])) { $msgObj->addMsg ( 'error', Config::lang("BBSPOSTMUSTLOGIN") ); } if (empty($_POST['info']['boardid'])) { $msgObj->addMsg ( 'error', '请选择版块'); } if (! $msgObj->hasMsg) { $user = get('user',$_COOKIE['userId']); $_Obj->uid = $_COOKIE['userId']; $_Obj->username = empty($user->username) ? "Unknow" :$user->username; $_Obj->guestip = NetUtil::getIp(); $_Obj->yz = 1; $_Obj->saveOrUpdate(); // $user->money += 10 ; $user->update(); header("Location:index.php?ac=index_list&m=bbs&bid=" . $_Obj->boardid); } else { $_GET['bid']=$_GET['bid']; $_GET['boardid']=$_POST['info']['boardid']; $this->setValue ( "Obj", $_Obj ); $this->post(); } } ``` 这里只需要POST['info']['id'] 即可修改任意帖子 重点是 $_COOKIE['userId'] 没有进行验证 主要伪造COOKIE 即可具有发布的权限。 这个文件最后 还有锁定板块功能 没有权限验证。 这个文件我都不忍心看了!多多啊! ### 漏洞证明: http://bbs.teamcen.com/thread-3-10.html 成功修改了帖子和伪造管理员回帖! [<img src="https://images.seebug.org/upload/201311/25101455efcae155f612a1813bb2d4ca0b0e4c87.jpg" alt="tcms_bbs.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201311/25101455efcae155f612a1813bb2d4ca0b0e4c87.jpg)