CakePHP Database\\Query::offset() and limit() methods are vulnerable to SQL injection
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
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| Composer package | cakephp/cakephp | >= 4.2.0, < 4.2.12, >= 4.3.0, < 4.3.11, >= 4.4.0, < 4.4.10 | 4.2.12, 4.3.11, 4.4.10 |
| Composer package | cakephp/database | >= 4.2.0, < 4.2.12, >= 4.3.0, < 4.3.11, >= 4.4.0, < 4.4.10 | 4.2.12, 4.3.11, 4.4.10 |
References
- https://github.com/cakephp/cakephp/security/advisories/GHSA-6g8q-qfpv-57wp
- https://nvd.nist.gov/vuln/detail/CVE-2023-22727
- https://github.com/cakephp/cakephp/commit/3f463e7084b5a15e67205ced3a622577cca7a239
- https://bakery.cakephp.org/2023/01/06/cakephp_4211_4311_4410_released.html
- https://github.com/cakephp/cakephp
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H- Weakness (CWE)
CWE-89- Platform
- Composer
- Package
cakephp/cakephp, cakephp/database- Disclosed
- 20.01.2023
- Updated
- 11.10.2026 10:22
Sources and licenses
OSV / GitHub Advisory Database - GHSA-6g8q-qfpv-57wp - CC BY 4.0
Vulnerability history: cakephp/cakephp
All published vulnerabilities of this package (Composer package), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 22
- First → latest
- 12.2019 09.2026
- Without a fix
- 0
- Exploited in attacks
- 0
Severity breakdown
- Critical 3
- High 8
- Medium 11
Disclosures per year
- 2019: 1
- 2020: 0
- 2021: 0
- 2022: 9
- 2023: 7
- 2024: 0
- 2025: 0
- 2026: 5
-
CakePHP Database\\Query::offset() and limit() methods are vulnerable to SQL injection this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.