ThinkPHP5.*版本发布安全更新
发布时间:2020-09-19, 02:12:48 分类:默认分类 | 编辑 off 网址 | 辅助
图集1/5
正文 1415字数 62,500阅读
5.0版本在think\App类的module方法的获取控制器的代码后面加上
if (!preg_match('/^[A-Za-z](\w|\.)*$/', $controller)) {
throw new HttpException(404, 'controller not exists:' . $controller);
}
Run code
Cut to clipboard
5.1版本
在think\route\dispatch\Url类的parseUrl方法,解析控制器后加上
if ($controller && !preg_match('/^[A-Za-z](\w|\.)*$/', $controller)) {
throw new HttpException(404, 'controller not exists:' . $controller);
}
Run code
Cut to clipboard
ThinkPHP官方博客
一句话代码:
http://www.xxxx.com/?s=index/\think\App/invokefunction&function=call_user_func_array&vars[0]=phpinfo&vars[1][]=1
如果修复成功,那这段代码将不会执行,thinkphp5就会有错误提示
Run code
Cut to clipboard
存在漏洞,出现phpinfo的页面
错误提示
ThinkPHP 5.1.x SQL注入漏洞
改进order方法解析
foreach ($order as $key => $val) {
if ($val instanceof Expression) {
$array[] = $val->getValue();
//} elseif (is_array($val)) {
} elseif (is_array($val) && preg_match('/\w/', $key)) {
$array[] = $this->parseOrderField($query, $key, $val);
} elseif ('[rand]' == $val) {
$array[] = $this->parseRand($query);
//} else {
} elseif (is_string($val)) {
if (is_numeric($key)) {
list($key, $sort) = explode(' ', strpos($val, ' ') ? $val : $val . ' ');
} else {
Run code
Cut to clipboard
Thinkphp5开启强制路由
文件:application->config.php
(支付宝)给作者钱财以资鼓励 (微信)→
标签: ThinkPHP25
暂无评论 »