thinkphp5远程漏洞执行漏洞

###一.远程漏洞执行漏洞1

标题: ThinkPHP5 <= 5.0.22 远程代码执行高危漏洞
动修复
5.0版本
在think\App类的module方法的获取控制器的代码后面加上

if (!preg_match(‘/^A-Za-z*$/‘, $controller)) {
throw new HttpException(404, ‘controller not exists:’ . $controller);
}

5.1版本

在think\route\dispatch\Url类的parseUrl方法,解析控制器后加上

if ($controller && !preg_match(‘/^A-Za-z*$/‘, $controller)) {
throw new HttpException(404, ‘controller not exists:’ . $controller);
}
官方文档:https://blog.thinkphp.cn/869075
修复参考文档
https://blog.csdn.net/dabao87/article/details/84966882

###二.远程漏洞2
官方修补方案:
https://github.com/top-think/framework/commit/4a4b5e64fa4c46f851b4004005bff5f3196de003
绿盟解决方案
http://blog.nsfocus.net/thinkphp-5-0-5-0-23-rce/
已经修复的系统