Vulnerability · Published Jan 17, 2023 · Assigned by GitHub_M
CVE-2023-22727Database Query::offset() and limit() vulnerable to SQL injection in cakephp
Critical 9.8
In plain English
A critical-severity SQL injection in cakephp from cakephp. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.9% (higher than 60% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
CakePHP is a development framework for PHP web apps. In affected versions the `Cake\Database\Query::limit()` and `Cake\Database\Query::offset()` methods are vulnerable to SQL injection if passed un-sanitized user request data. This issue has been fixed in 4.2.12, 4.3.11, 4.4.10. Users are advised to upgrade. Users unable to upgrade may mitigate this issue by using CakePHP's Pagination library. Manually validating or casting parameters to these methods will also mitigate the issue.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Packagist | cakephp/cakephp | 4.2.12 | GHSA-6g8q-qfpv-57wp |
| Packagist | cakephp/cakephp | 4.3.11 | GHSA-6g8q-qfpv-57wp |
| Packagist | cakephp/cakephp | 4.4.10 | GHSA-6g8q-qfpv-57wp |
| Packagist | cakephp/database | 4.2.12 | GHSA-6g8q-qfpv-57wp |
| Packagist | cakephp/database | 4.3.11 | GHSA-6g8q-qfpv-57wp |
| Packagist | cakephp/database | 4.4.10 | GHSA-6g8q-qfpv-57wp |
| Ubuntu:22.04:LTS | cakephp | no fix listed | UBUNTU-CVE-2023-22727 |
Affected products (as reported)
Weakness: CWE-89 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H