CVE-2020-15148: Yiisoft/yii2 Unsafe Deserialization Vulnerability
HIGHCVE-2020-15148 is a HIGH (CVSS 8.9) unsafe deserialization vulnerability (CWE-502: Deserialization of Untrusted Data) affecting Yiisoft/yii2 libraries in the Packagist ecosystem. The issue involves unsafe deserialization in yii 2. Remediation is available by upgrading affected packages to version 2.0.38.
CVE-2020-15148 at a Glance
Security Impact
CVSS: 8.9
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:H/A:H).
How to Fix CVE-2020-15148
To remediate this vulnerability, upgrade all affected Yiisoft/yii2 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade yiisoft/yii2 to 2.0.38
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for yiisoft/yii2
How to Check if You Are Affected
To determine whether your application is affected by CVE-2020-15148, inspect your project dependencies for Yiisoft/yii2:
inspect dependencies for yiisoft/yii2
Analyze the terminal output to locate any version of Yiisoft/yii2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.38), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-502: Deserialization of Untrusted Data, where the product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid. In Yiisoft/yii2, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2020-15148 Affected Yiisoft/yii2 Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
yiisoft/yii2
|
Packagist |
< 2.0.38
|
2.0.38
|
References
Frequently Asked Questions
What is CVE-2020-15148?
Which Yiisoft/yii2 versions are affected?
What version fixes CVE-2020-15148?
Is yiisoft/yii2 affected?
What is the CVSS score of CVE-2020-15148?
What CWE is associated with CVE-2020-15148?
How can I check Packagist dependencies for CVE-2020-15148?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-699q-wcff-g9mj",
"modified" : "2021-01-07T22:56:34Z",
"published" : "2020-09-15T18:19:56Z",
"aliases" : [ "CVE-2020-15148" ],
"summary" : "Unsafe deserialization in Yii 2",
"details" : "### Impact\n\nRemote code execution in case application calls `unserialize()` on user input containing specially crafted string.\n\n### Patches\n\n2.0.38\n\n### Workarounds\n\nAdd the following to BatchQueryResult.php:\n\n```php\npublic function __sleep()\n{\n throw new \\BadMethodCallException('Cannot serialize '.__CLASS__);\n}\n\npublic function __wakeup()\n{\n throw new \\BadMethodCallException('Cannot unserialize '.__CLASS__);\n}\n```\n\n### For more information\n\nIf you have any questions or comments about this advisory, [contact us through security form](https://www.yiiframework.com/security).",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "yiisoft/yii2"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.0.38"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/yiisoft/yii2/security/advisories/GHSA-699q-wcff-g9mj"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-15148"
}, {
"type" : "WEB",
"url" : "https://github.com/yiisoft/yii2/commit/9abccb96d7c5ddb569f92d1a748f50ee9b3e2b99"
}, {
"type" : "WEB",
"url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/yiisoft/yii2/CVE-2020-15148.yaml"
}, {
"type" : "WEB",
"url" : "https://www.yiiframework.com/news/303/yii-2-0-38"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-502" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2020-09-15T18:19:44Z",
"nvd_published_at" : null
}
}