9.8critical
Database Query::offset() and limit() vulnerable to SQL injection in cakephp
- Severity
- 9.8critical CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.93% (higher than 61% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-6g8q-qfpv-57wp
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
| Product or package | Versions | Reported by |
|---|---|---|
| cakephp cakephp | >= 4.2.0, < 4.2.12, >= 4.3.0, < 4.3.11, >= 4.4.0, < 4.4.10, from 4.2.0 before 4.2.12, from 4.3.0 before 4.3.11, from 4.4.0 before 4.4.10 | CVE List, NVD |
| cakephp/cakephp (Packagist) | from 4.2.0 before 4.2.12, from 4.3.0 before 4.3.11, from 4.4.0 before 4.4.10 | GitHub Advisory Database |
| cakephp/database (Packagist) | from 4.2.0 before 4.2.12, from 4.3.0 before 4.3.11, from 4.4.0 before 4.4.10 | GitHub Advisory Database |
All scores
| GitHub_M | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| GitHub | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Classification
SSVC (CISA-ADP): exploitation none, automatable yes, technical impact total.
What each source says
CVE List
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.
GitHub Advisory Database
Impact
The Cake\Database\Query::limit() and Cake\Database\Query::offset() methods are vulnerable to SQL injection if passed un-sanitized user request data.
Patches
This issue has been fixed in 4.2.12, 4.3.11, 4.4.10
Workarounds
Using CakePHP's Pagination library will mitigate this issue, as will validating or casting parameters to these methods.
References
https://bakery.cakephp.org/2023/01/06/cakephp_4211_4311_4410_released.html
NVD (es)
CakePHP es un framework de desarrollo para aplicaciones web PHP. En las versiones afectadas, los métodos `Cake\Database\Query::limit()` y `Cake\Database\Query::offset()` son vulnerables a la inyección SQL si se pasan datos de solicitud de usuario sin desinfectar. Este problema se solucionó en 4.2.12, 4.3.11, 4.4.10. Se recomienda a los usuarios que actualicen. Los usuarios que no puedan actualizar pueden mitigar este problema utilizando la librería de paginación de CakePHP. La validación manual o la conversión de parámetros a estos métodos también mitigará el problema.
References
| https://github.com/cakephp/cakephp/security/advisories/GHSA-6g8q-qfpv-57wp | third-party-advisory, web | |
| https://github.com/cakephp/cakephp/commit/3f463e7084b5a15e67205ced3a622577cca7a239 | patch, third-party-advisory, web | |
| https://bakery.cakephp.org/2023/01/06/cakephp_4211_4311_4410_released.html | release-notes, vendor-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2023-22727 | advisory | |
| https://github.com/cakephp/cakephp | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2023-22727 changed 2025-03-10 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-6g8q-qfpv-57wp changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2023-22727 changed 2026-06-17 | Public domain |