PHP

dedecms当中的/member/album_add.php SQL注入漏洞

字号+ 编辑: 种花家 修订: 种花家 来源: 原创 2023-09-08 我要说两句(0)

网上只能搜索到该漏洞的注入方式, 而不少朋友还不知道如何修复这个漏洞, 只是一下子把member整个目录删了, 还有更好的方法吗? 有的。

首先用编辑器打开member文件夹下的album_add.php

找到以下代码段:

    //生成文档ID
    $arcID = GetIndexKey($arcrank,$typeid,$sortrank,$channelid,$senddate,$mid);
    if(empty($arcID))
    {
        ShowMsg("无法获得主键,因此无法进行后续操作!","-1");
        exit();
    }
        $description = HtmlReplace($description, -1);//2011.06.30 增加html过滤 (by:织梦的鱼)
    //保存到主表
    $inQuery = "INSERT INTO `#@__archives`(id,typeid,sortrank,flag,ismake,channel,arcrank,click,money,title,shorttitle,
color,writer,source,litpic,pubdate,senddate,mid,description,keywords,mtype)
VALUES ('$arcID','$typeid','$sortrank','$flag','$ismake','$channelid','$arcrank','0','$money','$title','$shorttitle',
'$color','$writer','$source','$litpic','$pubdate','$senddate','$mid','$description','$keywords','$mtypesid'); ";

在保存到主表这一行上方插入一行过滤代码, 解决问题:

$mtypesid = intval($mtypesid);
阅完此文,您的感想如何?
  • 有用

    1

  • 没用

    0

  • 开心

    0

  • 愤怒

    0

  • 可怜

    0

1.如文章侵犯了您的版权,请发邮件通知本站,该文章将在24小时内删除;
2.本站标注原创的文章,转发时烦请注明来源;
3.交流群: PHP+JS聊天群

相关课文
  • mac开发接入微信公众号接口返回报错 cURL error 56: SSLRead() return error -9806

  • pecl安装程序时报错Array and string offset access syntax with curly braces is no longer supported

  • PHP的换行符是什么

  • 由于商家传入的H5交易参数有误,该笔交易暂时无法完成,请联系商家解决

我要说说
网上宾友点评