CakePHP: Multiple methods in FunctionsBuilder vulnerable to SQL injection
cakephp
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| cakephp/database Packagist |
|
|
cakephp
| Product | Affected | Fixed in |
|---|---|---|
| cakephp/database Packagist |
|
|
5.2.145.3.7| cakephp/cakephp Packagist |
|
|
CakePHP is a rapid development framework for PHP. Prior to 4.5.12, 4.6.5, 5.1.9, 5.2.14, and 5.3.7, FunctionsBuilder::cast, FunctionsBuilder::extract, FunctionsBuilder::datePart, and FunctionsBuilder::dateAdd in src/Database/FunctionsBuilder.php accept user-controlled dataType, part, or unit values and incorporate them into generated SQL as unescaped structural fragments. An application that passes untrusted input to these parameters can permit SQL injection with confidentiality, integrity, and availability impact according to the database connection's privileges. This issue is fixed in versions 4.5.12, 4.6.5, 5.1.9, 5.2.14, and 5.3.7.
From the CVE record · GitHub_M
CakePHP FunctionsBuilder methods incorporate user-controlled values into generated SQL without escaping them as structural fragments. If an application passes untrusted input to the affected parameters, an attacker can inject SQL, with impact determined by the database connection's privileges. Authentication and user-interaction requirements are not specified.
Teams running affected versions of the Packagist packages cakephp/database or cakephp/cakephp should check their applications.