阿里云提示DISCUZ uc.key泄漏导致代码注入漏洞修复

查找

1
2
3
4
foreach($post as $k => $v) {
$data['findpattern'][$k] = $v['findpattern'];
$data['replace'][$k] = $v['replacement'];
}

改成

1
2
3
4
5
6
7
8
9
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'];
}

查找

1
$UC_API = $post['UC_API'];

改成

1
2
3
4
5
6
7
8
//$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修改结束

文章目录