冬之梅 發表於 2023-10-23 00:00:00

浅析DedeCMS投票模块漏洞的解决方法

<p>
        <span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>打开/include/dedevote.class.php文件,查 找$this-&gt;dsql-&gt;ExecuteNoneQuery("UPDATE `dede_vote` SET totalcount='".($this-&gt;VoteInfos['totalcount']+1)."',votenote='".addslashes($items)."' WHERE aid='".$this-&gt;VoteID."'"); </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><strong style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><font color="#ff0000">修改为 </font></strong><br><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>$this-&gt;dsql-&gt;ExecuteNoneQuery("UPDATE `dede_vote` SET totalcount='".($this-&gt;VoteInfos['totalcount']+1)."',votenote='".mysql_real_escape_string($items)."' WHERE aid='".mysql_real_escape_string($this-&gt;VoteID)."'"); </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><strong style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><font color="#ff0000">注: </font></strong><br><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>* addslashes() 是强行加\; </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>* mysql_real_escape_string() 会判断字符集,但是对PHP版本有要求;(PHP 4 &gt;= 4.0.3, PHP 5) </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>* mysql_escape_string不考虑连接的当前字符集。(PHP 4 &gt;= 4.0.3, PHP 5, 注意:在PHP5.3中已经弃用这种方法,不推荐使用) </span></p>
頁: [1]
查看完整版本: 浅析DedeCMS投票模块漏洞的解决方法