DZ原生代码交流学习,买插件不如自己动手解决
 
发新帖
楼主: 天启
查看: 961|回复: 0

[教程] DZ点评权限存在绕过风险的bug修复

[复制链接]
天启VIP6 发表于 2019-11-7 16:30:30 | 显示全部楼层
bug描述:用户可用模拟post提交数据的形式,绕过点评的前端权限判断,直接进行提交操作;危险级别:弱
修复方法:

打开source/include/post/post_newreply.php
搜索
  1. if(!$post) {
  2.                 showmessage('post_nonexistence', NULL);
  3.         }
复制代码
替换为
  1. if(!$post || !($_G['setting']['commentpostself'] || $post['authorid'] != $_G['uid']) || !(($post['first'] && $_G['setting']['commentfirstpost'] && in_array($_G['group']['allowcommentpost'], array(1, 3)) || (!$post['first'] && in_array($_G['group']['allowcommentpost'], array(2, 3)))))) {
  2.                 showmessage('postcomment_error');
  3.         }
复制代码
保存覆盖上传即可

快速回复 返回顶部 返回列表