tp5.0.7 修复getshell漏洞

这里 接手项目用的是 tp5.0.7 突然想到前段事件的tp bug 事件 就试了下 发现确实有这种情况 

参考帖子:

https://bbs.ichunqiu.com/thread-48687-1-1.html

https://blog.csdn.net/Bul1et/article/details/85319468

本地测试的时候 到 &function=call_user_func_array&vars[0]=system&vars[1][]=id 的时候 nginx 出现了一个报错 没有成功进行复现 

但是 前面的 invokefunction 方法确实是已经进到了 call_user_func_array 函数也已经执行了 

官方提供的修复姿势:

https://blog.thinkphp.cn/869075

PHPTutorial\WWW\tp5.0.7\thinkphp\library\think\App.php

358行左右

module 方法中 

 

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

测试 修复完成 报错 

这里 应该就是修复完成了吧 和 tp5.0.24 提示一致 

这里显示报错 是因为 debug 没有关 生产环境关掉就好了 不会暴露出相应的信息

原文地址:https://www.cnblogs.com/y734290209/p/10750476.html