Skip to content

Unsafe deserialization in Yii 2

High severity GitHub Reviewed Published Sep 14, 2020 in yiisoft/yii2 • Updated Feb 7, 2024

Package

composer yiisoft/yii2 (Composer)

Affected versions

< 2.0.38

Patched versions

2.0.38

Description

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.

References

@samdark samdark published to yiisoft/yii2 Sep 14, 2020
Reviewed Sep 15, 2020
Published to the GitHub Advisory Database Sep 15, 2020
Last updated Feb 7, 2024

Severity

High
8.9
/ 10

CVSS base metrics

Attack vector
Network
Attack complexity
High
Privileges required
None
User interaction
None
Scope
Changed
Confidentiality
Low
Integrity
High
Availability
High
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:H/A:H

Weaknesses

CVE ID

CVE-2020-15148

GHSA ID

GHSA-699q-wcff-g9mj

Source code

No known source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.