Yii2 反序列化漏洞
受影响版本 < Yii2.0.38版本
BatchQueryResult.php 文件中的BatchQueryResult类
所有版本
DiskKeyCache.php 文件中的Swift_KeyCache_DiskKeyCache类
RunProcess.php 文件中的RunProcess类
修复方案:
在类中加入以下方法
public function __sleep()
{
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
}
public function __wakeup()
{
throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
}
参考以下网址:
https://github.com/yiisoft/yii2/security/advisories/GHSA-699q-wcff-g9mj
https://blog.csdn.net/he_and/article/details/108684623