最近爆出了Thinkphp5.0.*全版本代码执行,其中5.1与5.2全版本在生产环境下同样也存在代码执行漏洞
漏洞分析:
文件位置:
\thinkphp\library\think\Request.php
/**
* 当前的请求类型
* @access public
* @param bool $origin 是否获取原始请求类型
* @return sting
*/
public function method($origin = false)
{
if($origin){
//获取原始请求类型
return $this->server('REQUEST_METHOD') ?: 'GET'
}elseif (!$this->method){
if(isset($_POST[$this->config['var_method']])){
$this->method = strtoupper($_POST[$this->config['var_method']]);
$method = strtolower($this->method);
$this->($method) = $_POST;
}elseif ($this->server('HTTP_X_HTTP_METHOD_OVERRIDE')) {
$this->method = strtoupper($this->server('HTTP_X_HTTP_METHOD_OVERRIDE'));
}else {
$this->method