对模块输入过滤不严格 影响范围在3.6版本到4.7(for now)
//WriteFile 函数 写入文件 $set=$this->Post['sharetemp']; $set = jstripslashes($set); $file = ROOT_PATH . 'templates/default/share/sharetemp_'.$shareid.'. html '; if(!is_dir(dirname($file))) { jmkdir(dirname($file)); } $len = Load::lib('io', 1)->WriteFile($file, $set); if(!$len) { die($file." 文件无法写入,请检查是否有可写权限。"); } { $topic_list[$k]['content'] = stripslashes($topic_list[$k]['content']); if($share['string'] && $share['string'] > 0){ $topic_list[$k]['content'] = cut_str(strip_tags($topic_list[$k]['content']),$share['string'],'<a>'); } }
include $this->TemplateHandler->Template('share/sharetemp_'.$ids);<<<直接进行包含 导致代码执行
修复方案:
过滤标签 严格规定输入 修改正则
查看更多关于记事狗后台代码执行漏洞(可getshell) - 网站安全的详细内容...