阿里提示 Discuz uc.key 泄露导致代码注入漏洞uc.php的解决方法
约285行:
view sourceprint?
01
function updateapps($get, $post) {
02
if(!API_UPDATEAPPS) {
03
return API_RETURN_FORBIDDEN;
04
}
05
//$UC_API = $post['UC_API'];
06
//dz官网修复uc-key漏洞。以下加上
07
$UC_API = '';
08
if($post['UC_API']) {
09
$UC_API = str_replace(array('\'', '"', '\\', "\0", "\n", "\r"), '', $post['UC_API']);
10
unset($post['UC_API']);
11
}
12
//end
-------------------------
-------------------------
-------------------------
if(!API_UPDATEBADWORDS) {
return API_RETURN_FORBIDDEN;
}
$data = array();
if(is_array($post)) {
foreach($post as $k => $v) {
//dz uc-key
if(substr($v['findpattern'], 0, 1) != '/' || substr($v['findpattern'], -3) != '/is') {
$v['findpattern'] = '/' . preg_quote($v['findpattern'], '/') . '/is';
}
//end
$data['findpattern'][$k] = $v['findpattern'];
$data['replace'][$k] = $v['replacement'];
}
}
function updateapps($get, $post) {
global $_G;
if(!API_UPDATEAPPS) {
return API_RETURN_FORBIDDEN;
}
//$UC_API = $post['UC_API'];
//dz uc-key
$UC_API = '';
if($post['UC_API']) {
$UC_API = str_replace(array('\'', '"', '\\', "\0", "\n", "\r"), '', $post['UC_API']);
unset($post['UC_API']);
}
//end
$cachefile = DISCUZ_ROOT.'./uc_client/data/cache/apps.php';
-------------------------
-------------------------
-------------------------
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。