久久久久av_欧美日韩一区二区在线_国产精品三区四区_日韩中字在线

Discuz! 官方交流社區(qū)

標(biāo)題: dz發(fā)帖 火車頭 發(fā)布 提示含有非法字符,已經(jīng)被系統(tǒng)拒絕 [打印本頁]

作者: mylogins    時間: 2021-8-18 13:58
標(biāo)題: dz發(fā)帖 火車頭 發(fā)布 提示含有非法字符,已經(jīng)被系統(tǒng)拒絕
話說 都1202年了
發(fā)布個別帖子 或火車頭發(fā)布的時候


系統(tǒng)還出現(xiàn) 您當(dāng)前的訪問請求當(dāng)中含有非法字符,已經(jīng)被系統(tǒng)拒絕

這個問題很早就出現(xiàn)了  ,網(wǎng)上的修改方法,在最新的x3.4版本里沒有作用












作者: 老周部落    時間: 2021-8-18 16:06
火車頭自己的問題
作者: pk9945    時間: 2021-8-21 09:48
\source\class\discuz\discuz_application.php
打開discuz_application.php這個文件,
找到下面這段代碼

private function _xss_check() {

                static $check = array('"', '>', '<', '\'', '(', ')', 'CONTENT-TRANSFER-ENCODING');

                if(isset($_GET['formhash']) && $_GET['formhash'] !== formhash()) {

                        system_error('request_tainting');

                }

                if($_SERVER['REQUEST_METHOD'] == 'GET' ) {

                        $temp = $_SERVER['REQUEST_URI'];

                } elseif(empty ($_GET['formhash'])) {

                        $temp = $_SERVER['REQUEST_URI'].file_get_contents('php://input');

                } else {

                        $temp = '';

                }

                if(!empty($temp)) {

                        $temp = strtoupper(urldecode(urldecode($temp)));

                        foreach ($check as $str) {

                                if(strpos($temp, $str) !== false) {

                                        system_error('request_tainting');

                                }

                        }

                }

                return true;

        }


替換成下面這段代碼

private function _xss_check() {

                $temp = strtoupper(urldecode(urldecode($_SERVER['REQUEST_URI'])));

                if(strpos($temp, '<') !== false || strpos($temp, '"') !== false || strpos($temp, 'CONTENT-TRANSFER-ENCODING') !== false) {

                        system_error('request_tainting');

                }

                return true;

        }
就可以解決火車頭采集非法字符了
作者: Killer    時間: 2021-8-21 10:19
pk9945 發(fā)表于 2021-8-21 09:48
\source\class\discuz\discuz_application.php
打開discuz_application.php這個文件,
找到下面這段代碼

修改XSS注入的防護(hù)來避開這個問題可不是個好方法
作者: mylogins    時間: 2021-8-26 10:12
Killer 發(fā)表于 2021-8-21 10:19
修改XSS注入的防護(hù)來避開這個問題可不是個好方法

修改XSS注入的防護(hù)怎么設(shè)置




歡迎光臨 Discuz! 官方交流社區(qū) (http://www.9999xn.com/) Powered by Discuz! W1.0