Blogger Information
Blog 4
fans 0
comment 0
visits 1976
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
阿里云提示ecshop中sql注入漏洞的修复
Tsui的博客
Original
641 people have browsed it

修复方法如下:


1. /admin/shopinfo.php


大概在第53、71、105、123行,4个地方修复方式都一样


admin_priv('shopinfo_manage');

修改为


admin_priv('shopinfo_manage');

$_REQUEST['id'] = intval($_REQUEST['id']);





2. /admin/shophelp.php


 大概在第81、105、133、155行,4个地方修复方式都一样


admin_priv('shophelp_manage');

修改为


admin_priv('shophelp_manage');

$_POST['id'] = intval($_POST['id']);


3. /api/client/includes/lib_api.php


大概在第246行,API_UserLogin()函数中



/* SQL注入过滤 */

if (get_magic_quotes_gpc()) {     

    $post['UserId']=$post['UserId']     

} else {     

    $post['UserId']=addslashes($post['UserId']);     

}

$post['username'] = isset($post['UserId']) ? trim($post['UserId']) : '';

$post['password'] = isset($post['Password']) ? strtolower(trim($post['Password'])) : '';



4. /admin/edit_languages.php


 大概在第120行


$dst_items[$i] = $_POST['item_id'][$i] .' = '. '"' .$_POST['item_content'][$i]. '";';

修改为


$dst_items[$i] = $_POST['item_id'][$i] .' = '. '\'' .$_POST['item_content'][$i]. '\';';



5. /admin/affiliate_ck.php


方法一

31和51行


由$logdb = get_affiliate_ck();改为

$_GET[auid] = intval($_GET[auid]); $logdb = get_affiliate_ck();


方法二

 大概在第291行,get_affiliate_ck()函数中


$sqladd = ' AND a.user_id=' . $_GET['auid'];

修改为


$sqladd = ' AND a.user_id=' . intval($_GET['auid']);



6. /admin/comment_manage.php


 大概在第336行,get_comment_list()函数中


$filter['sort_by'] = empty($_REQUEST['sort_by']) ? 'add_time' : trim($_REQUEST['sort_by']);

$filter['sort_order'] = empty($_REQUEST['sort_order']) ? 'DESC' : trim($_REQUEST['sort_order']);

修改为


$sort = array('comment_id','comment_rank','add_time','id_value','status');

$filter['sort_by'] = in_array($_REQUEST['sort_by'], $sort) ? trim($_REQUEST['sort_by']) : 'add_time'; 

$filter['sort_order'] = empty($_REQUEST['sort_order']) ? 'DESC' : 'ASC';



7. /includes/modules/payment/alipay.php 和 /app/includes/modules/payment/alipay.php


 大概在第183行,respond()函数中


$order_sn = trim($order_sn);

修改为


$order_sn = trim(addslashes($order_sn));



8. /includes/lib_insert.php


对以下变量进行过滤


$arr['id'] = intval($arr['id']);

$arr['num'] = intval($arr['num']);

$arr['type'] = addslashes($arr['type']);



9. /admin/integrate.php


大概在第109行


$code = empty($_GET['code']) ? '' : trim($_GET['code']);

修改为


$code = empty($_GET['code']) ? '' : trim(addslashes($_GET['code']));



10./install/index.php

修复处有1处。


搜索如下代码(397行):


$result = deal_aftermath();



直接替换如下代码:


if (file_exists(ROOT_PATH . 'data/install.lock')) { $step = 'error'; $err->add($_LANG['has_locked_installer']); $err_msg = implode(',', $err->get_all()); $smarty->assign('err_msg', $err_msg); $smarty->display('error.php'); break; } 

$result = deal_aftermath();


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!