HighGHSA-699q-wcff-g9mjCVE-2020-15148
Unsafe deserialization in Yii 2
Published 15 Sept 2020 · Updated 8 Jul 2026
Affected package
yiisoft/yii2Composer
- Affected
- <2.0.38
- Fixed in
- 2.0.38
Update to the fixed version for your release line, for example:
composer require yiisoft/yii2:^2.0.38Details
Impact
Remote code execution in case application calls unserialize() on user input containing specially crafted string.
Patches
2.0.38
Workarounds
Add the following to BatchQueryResult.php:
public function __sleep()
{
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
}
public function __wakeup()
{
throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
}For more information
If you have any questions or comments about this advisory, contact us through security form.
Is GHSA-699q-wcff-g9mj in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected yiisoft/yii2, and gives you the command that fixes it.
References
- Linkgithub.com/yiisoft/yii2/security/advisories/GHSA-699q-wcff-g9mj
- Advisorynvd.nist.gov/vuln/detail/CVE-2020-15148
- Linkgithub.com/yiisoft/yii2/commit/9abccb96d7c5ddb569f92d1a748f50ee9b3e2b99
- Linkgithub.com/FriendsOfPHP/security-advisories/blob/master/yiisoft/yii2/CVE-2020-15148.yaml
- Linkwww.yiiframework.com/news/303/yii-2-0-38
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.