composer create-project yiisoft/yii2-app-basic app

搜索__destruct和__wakeup grep -A 10 -rn "__destruct"
yii\db\BatchQueryResult:

這里調用了close,搜索close發現
yii\web\DbSession類中的close:

而這里又調用了getIsActive
public function getIsActive()
{
return session_status() === PHP_SESSION_ACTIVE;
}
yii2中的debug和gii這兩個默認擴展都存在(不一定要開啟)時,這里session_status()返回true
yii\web\MultiFieldSession的composeFields:

call_user_func可控
而yii\rest\IndexAction中的run
public function run()
{
if ($this->checkAccess) {
call_user_func($this->checkAccess, $this->id);
}
return $this->prepareDataProvider();
}
其中call_user_func兩個可控參數,可以構造傳入對象作參數形式,例子:[(new test), "aaa"] ,調用其中的aaa方法.

