CVE-2018-7269
Description
The findByCondition function in framework/db/ActiveRecord.php in Yii 2.x before 2.0.15 allows remote attackers to conduct SQL injection attacks via a findOne() or findAll() call, unless a developer recognizes an undocumented need to sanitize array input.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Yii 2.x before 2.0.15 allows SQL injection via findOne() and findAll() when array input is not sanitized, requiring developer awareness.
Vulnerability
The vulnerability resides in the findByCondition function in framework/db/ActiveRecord.php of Yii 2.x versions prior to 2.0.15. The findOne() and findAll() methods accept array input for filtering conditions, but the documentation did not explicitly warn that passing unfiltered user input could be dangerous. This lack of clarity led to potential SQL injection, as the framework did not automatically sanitize array parameters. Affected versions include all Yii 2 releases before 2.0.15 [1][2][4].
Exploitation
An attacker can exploit this vulnerability by providing malicious array input to the findOne() or findAll() methods. The attacker does not need authentication if the methods are exposed to user input via web requests. The undocumented need for input sanitization meant developers might inadvertently pass unsanitized input, allowing the attacker to inject arbitrary SQL clauses. The exploitation is straightforward – the attacker crafts array keys or values that modify the query condition [2][4].
Impact
Successful exploitation allows an attacker to execute arbitrary SQL queries against the database. This can lead to information disclosure, bypassing access control checks, data manipulation, or complete database compromise. The impact is severe because it directly affects the ActiveRecord query layer, which is commonly used in Yii applications [1][2].
Mitigation
Yii 2.0.15, released on March 21, 2018, fixes the issue by limiting findOne() and findAll() to filter only on columns that are ActiveRecord properties. Developers should upgrade to version 2.0.15 or later. As a workaround, ensure that any array input passed to these methods is properly sanitized before use [2][4]. No known inclusion in CISA's Known Exploited Vulnerabilities (KEV) catalog.
AI Insight generated on May 22, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
yiisoft/yii2-devPackagist | < 2.0.12.1 | 2.0.12.1 |
yiisoft/yii2-devPackagist | >= 2.0.13, < 2.0.13.2 | 2.0.13.2 |
yiisoft/yii2-devPackagist | >= 2.0.14, < 2.0.15 | 2.0.15 |
Affected products
2Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
5- github.com/advisories/GHSA-hhg2-g6h6-c266ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2018-7269ghsaADVISORY
- www.yiiframework.com/news/168/releasing-yii-2-0-15-and-database-extensions-with-security-fixes/mitrex_refsource_CONFIRM
- github.com/FriendsOfPHP/security-advisories/blob/master/yiisoft/yii2-dev/CVE-2018-7269.yamlghsaWEB
- www.yiiframework.com/news/168/releasing-yii-2-0-15-and-database-extensions-with-security-fixesghsaWEB
News mentions
0No linked articles in our index yet.