由于框架对控制器名没有进行足够的检测会导致在没有开启强制路由的情况下可能的getshell漏洞。最直接的影响为index.php直接被篡改成首页html的内容!

 

5.0版本

thinkphp/library/think/App.php  类的module方法的获取控制器的代码后面加上

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

}

修复Thinkphp框架5.0和5.1版本的远程代码执行安全漏洞

 

5.1版本

thinkphp/library/think/route/dispatch/Url.php  类的parseUrl方法,解析控制器后加上   添加

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

修复Thinkphp框架5.0和5.1版本的远程代码执行安全漏洞

 

 验证成功 即可。

相关文章:

  • 2021-12-07
  • 2021-12-22
  • 2022-12-23
  • 2021-10-31
  • 2021-10-24
猜你喜欢
  • 2021-09-27
  • 2021-09-29
  • 2021-08-16
  • 2021-05-19
  • 2022-12-23
  • 2021-07-02
相关资源
相似解决方案