Skip to content

Commit 9abccb9

Browse files
authored
Merge pull request from GHSA-699q-wcff-g9mj
* Fix unsafe unserialize() * Add changelog and comments on why unserialize() is disabled * Add since tag
1 parent 52ae0da commit 9abccb9

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

Diff for: framework/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Yii Framework 2 Change Log
44
2.0.38 under development
55
------------------------
66

7+
- Bug: (CVE-2020-15148): Disable unserialization of `yii\db\BatchQueryResult` to prevent remote code execution in case application calls unserialize() on user input containing specially crafted string (samdark, russtone)
78
- Enh #18213: Do not load fixtures with circular dependencies twice instead of throwing an exception (JesseHines0)
89
- Bug #18066: Fix `yii\db\Query::create()` wasn't using all info from `withQuery()` (maximkou)
910
- Bug #18269: Fix integer safe attribute to work properly in `yii\base\Model` (Ladone)

Diff for: framework/db/BatchQueryResult.php

+11
Original file line numberDiff line numberDiff line change
@@ -223,4 +223,15 @@ private function getDbDriverName()
223223

224224
return null;
225225
}
226+
227+
/**
228+
* Unserialization is disabled to prevent remote code execution in case application
229+
* calls unserialize() on user input containing specially crafted string.
230+
* @see CVE-2020-15148
231+
* @since 2.0.38
232+
*/
233+
public function __wakeup()
234+
{
235+
throw new \BadMethodCallException('Cannot unserialize ' . __CLASS__);
236+
}
226237
}

0 commit comments

Comments
 (0)