Discuz uc.key泄露导致代码注入漏洞修复

Discuz uc.key泄露导致代码注入漏洞修复

漏洞名称:Discuz uc.key泄露导致代码注入漏洞

文件路径:bbs/api/uc.php

修复方式:
1. 查找 updatebadwords 函数:
function updatebadwords($get, $post){
    // ...
    // 添加: 约241行    
    // Discuz uc.key泄露导致代码注入漏洞 
    if(substr($v['findpattern'], 0, 1) != '/' || substr($v['findpattern'], -3) != '/is') { 
        $v['findpattern'] = '/' . preg_quote($v['findpattern'], '/') . '/is'; 
    }
    // -- end : 2016-08-22 --
    
    $data['findpattern'][$k] = $v['findpattern'];
    // ...
}

2. 查找 updateapps 函数:

function updateapps($get, $post) {
    // ...
    // 修改: 约280行 
    $UC_API = '';
    if($post['UC_API']) {
        // $UC_API = $post['UC_API']; // 注释
        $UC_API = str_replace(array('\'', '"', '\\', "\0", "\n", "\r"), '', $post['UC_API']);
        unset($post['UC_API']);
    }
    // ...
}

发表评论

邮箱地址不会被公开。 必填项已用*标注