- Packages
- cakephp/database, cakephp/cakephp
- Fixed in
- 4.5.12, 4.6.5, 5.1.9, 5.2.14, 5.3.7
- Published
- Thu 17 Sep 2026, 21:28 LisbonUpdated Sun 25 Oct 2026, 22:25 Lisbon
- Installs on Packagist
- 29M
In plain words
An attacker can inject SQL if your application passes user-controlled data to certain parameters of CakePHP's FunctionsBuilder methods. The affected parameters are $dataType in cast(), $part in extract() and datePart(), and $unit in dateAdd().
Affected versions
| Package | Affected | Fixed in |
|---|---|---|
| cakephp/database | >= 4.6.0, < 4.6.5 | 4.6.5 |
| cakephp/database | >= 5.0.0, < 5.1.9 | 5.1.9 |
| cakephp/database | >= 5.2.0, < 5.2.14 | 5.2.14 |
| cakephp/database | >= 5.3.0, < 5.3.7 | 5.3.7 |
| cakephp/cakephp | < 4.5.12 | 4.5.12 |
| cakephp/cakephp | >= 4.6.0, < 4.6.5 | 4.6.5 |
| cakephp/cakephp | >= 5.0.0, < 5.1.9 | 5.1.9 |
| cakephp/cakephp | >= 5.2.0, < 5.2.14 | 5.2.14 |
| cakephp/cakephp | >= 5.3.0, < 5.3.7 | 5.3.7 |
| cakephp/database | >= 3.0.0, < 4.5.12 | 4.5.12 |
Am I affected?
Check composer.lock for cakephp/database or cakephp/cakephp. Both are affected at >= 4.6.0, < 4.6.5, >= 5.0.0, < 5.1.9, >= 5.2.0, < 5.2.14 and >= 5.3.0, < 5.3.7. Earlier affected versions are >= 3.0.0, < 4.5.12 for cakephp/database and < 4.5.12 for cakephp/cakephp. If your version is affected, review calls to FunctionsBuilder::cast(), extract(), datePart() and dateAdd() to see whether user-controlled data can reach $dataType, $part or $unit, respectively.
What to do
Check which version you have, then update to a fixed release for your branch (4.5.12, 4.6.5, 5.1.9, 5.2.14, 5.3.7):
composer show cakephp/database | grep versions
composer update cakephp/database
If your version constraint in composer.json keeps you below a fixed release, raise it first. Whether your configuration is affected, and the exact version ranges, are in the advisory itself.
If you cannot update yet
Do not pass user-controlled data to $dataType in cast(), $part in extract() or datePart(), or $unit in dateAdd().
The advisory's description
Impact
The FunctionsBuilder::cast($field, $dataType), extract($part, $expr), datePart($part, $expr), dateAdd($expr, $value, $unit) methods are vulnerable to SQL injection if user controlled data is supplied to the ($dataType / $part / $unit) parameters.
Patches
5.3.7, 5.2.14, 5.1.9, 4.6.5, 4.5.12 contain fixes
Workarounds
Don't provide user controlled data to these functions/parameters.
Weakness: CWE-89 Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). Reported by unknownhad, mfn.
The advisory
- GitHub Advisory Database: GHSA-vjqc-q4mp-2rvf, with who is affected and how
- OSV.dev: GHSA-vjqc-q4mp-2rvf
- The week's digest, with the other advisories from 14 Sep 2026
- All advisories for cakephp/database
- All advisories for cakephp/cakephp