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交易參數有誤,該筆交易暫時無法完成,請聯系商家解決

我要說說
網上賓友點評