CVE-2023-22727
JSON

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 packageVersionsReported 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.10CVE 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.10GitHub 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.10GitHub Advisory Database

All scores

GitHub_M9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
GitHub9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Classification

CWE-89

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

Sources

SourceRecordLicence
CVE ListCVE-2023-22727 changed 2025-03-10CVE Terms of Use
GitHub Advisory DatabaseGHSA-6g8q-qfpv-57wp changed 2026-09-10CC-BY-4.0
NVDCVE-2023-22727 changed 2026-06-17Public domain