因爲ThinkPHP5框架對控制器名沒有進行足夠的安全檢測,致使在沒有開啓強制路由的狀況下,黑客構造特定的請求,可直接GetWebShell。php
嚴重thinkphp
ThinkPHP 5.0系列 < 5.0.23
ThinkPHP 5.1系列 < 5.1.31shell
ThinkPHP 5.0系列 5.0.23
ThinkPHP 5.1系列 5.1.31安全
本次版本更新主要涉及一個安全更新,因爲框架對控制器名沒有進行足夠的檢測會致使在沒有開啓強制路由的狀況下可能的
getshell
漏洞,受影響的版本包括5.0
和5.1
版本,推薦儘快更新到最新版本。
若是各類緣由暫時沒法更新到最新版本(早期版本升級到最新版本可能存在兼容性問題,請首先參考官方手冊的升級指導章節)框架
5.1版本spa
thinkphp/library/think/route/dispatch/Url.php 類的parseUrl方法,解析控制器後加上 添加code
if ($controller && !preg_match('/^[A-Za-z](\w|\.)*$/', $controller)) {
throw new HttpException(404, 'controller not exists:' . $controller);
}blog
5.0版本路由
thinkphp/library/think/App.php 類的module方法的獲取控制器的代碼後面加上get
if (!preg_match('/^[A-Za-z](\w|\.)*$/', $controller)) {
throw new HttpException(404, 'controller not exists:' . $controller);
}
框架升級