CVE-2018-20745: Yiisoft/yii2 Yii Incorrectly Implements CORS Vulnerability
MODERATECVE-2018-20745 is a MODERATE (CVSS 5.9) yii incorrectly implements cors vulnerability (CWE-346: Origin Validation Error) affecting Yiisoft/yii2 libraries in the Packagist ecosystem. The issue involves yii incorrectly implements cors. Remediation is available by upgrading affected packages to version 2.0.16.
CVE-2018-20745 at a Glance
Security Impact
CVSS: 5.9
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N).
How to Fix CVE-2018-20745
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.16
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-2018-20745, 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.16), 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-346: Origin Validation Error, where the product does not properly verify that the source of data or communication is 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-2018-20745 Affected Yiisoft/yii2 Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
yiisoft/yii2
|
Packagist |
< 2.0.16
|
2.0.16
|
References
Frequently Asked Questions
What is CVE-2018-20745?
Which Yiisoft/yii2 versions are affected?
What version fixes CVE-2018-20745?
Is yiisoft/yii2 affected?
What is the CVSS score of CVE-2018-20745?
What CWE is associated with CVE-2018-20745?
How can I check Packagist dependencies for CVE-2018-20745?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-cr6r-6xm9-ww22",
"modified" : "2023-08-28T23:18:09Z",
"published" : "2022-05-14T01:33:07Z",
"aliases" : [ "CVE-2018-20745" ],
"summary" : "Yii Incorrectly Implements CORS",
"details" : "Yii 2.x through 2.0.15.1 actively converts a wildcard CORS policy into reflecting an arbitrary Origin header value, which is incompatible with the CORS security design, and could lead to CORS misconfiguration security problems.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "yiisoft/yii2"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.0.16"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-20745"
}, {
"type" : "WEB",
"url" : "https://github.com/yiisoft/yii2/issues/16193"
}, {
"type" : "WEB",
"url" : "https://github.com/yiisoft/yii2/pull/16198"
}, {
"type" : "WEB",
"url" : "https://www.usenix.org/system/files/conference/usenixsecurity18/sec18-chen.pdf"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-346" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2023-08-28T23:18:09Z",
"nvd_published_at" : "2019-01-28T08:29:00Z"
}
}