CVE-2023-22727
Database Query::offset() and limit() vulnerable to SQL injection in cakephp
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
CVE List Score used
9.8
Database Query::offset() and limit() vulnerable to SQL injection in cakephp
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.
- Record
CVE-2023-22727- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-89
- Updated
- 2026-11-02
EUVDEUVD-2023-0361
9.8
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.
- Record
EUVD-2023-0361- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-6g8q-qfpv-57wp
9.8
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
- Record
GHSA-6g8q-qfpv-57wp- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-89
- Updated
- 2026-11-02
NVD
9.8
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.
- Record
CVE-2023-22727- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-89
- Updated
- 2026-11-02
OSV
9.8
Database Query::offset() and limit() vulnerable to SQL injection in cakephp
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.
- Record
CVE-2023-22727- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-89
- Updated
- 2026-11-02
OSVDEBIAN-CVE-2023-22727
9.8
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.
- Record
DEBIAN-CVE-2023-22727- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVGHSA-6g8q-qfpv-57wp
9.8
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
- Record
GHSA-6g8q-qfpv-57wp- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-89
- Updated
- 2026-11-02
OSVUBUNTU-CVE-2023-22727
9.8
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.
- Record
UBUNTU-CVE-2023-22727- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-03
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
cakephp/cakephpPackagist |
4.2.0 up to 4.2.12 | 4.2.12 |
cakephp/cakephpPackagist |
4.3.0 up to 4.3.11 | 4.3.11 |
cakephp/cakephpPackagist |
4.4.0 up to 4.4.10 | 4.4.10 |
cakephp/databasePackagist |
4.2.0 up to 4.2.12 | 4.2.12 |
cakephp/databasePackagist |
4.3.0 up to 4.3.11 | 4.3.11 |
cakephp/databasePackagist |
4.4.0 up to 4.4.10 | 4.4.10 |
cakephp/cakephpPackagist |
4.2.0 up to 4.2.12, plus listed versions 4.2.14.2.104.2.114.2.24.2.3 Show 6 moreShow less4.2.44.2.54.2.64.2.74.2.84.2.9 |
4.2.12 |
cakephp/cakephpPackagist |
4.3.0 up to 4.3.11, plus listed versions 4.3.14.3.104.3.24.3.34.3.4 Show 5 moreShow less4.3.54.3.64.3.74.3.84.3.9 |
4.3.11 |
cakephp/cakephpPackagist |
4.4.0 up to 4.4.10, plus listed versions 4.4.14.4.24.4.34.4.44.4.5 Show 4 moreShow less4.4.64.4.74.4.84.4.9 |
4.4.10 |
cakephp/databasePackagist |
4.2.0 up to 4.2.12, plus listed versions 4.2.14.2.104.2.114.2.24.2.3 Show 6 moreShow less4.2.44.2.54.2.64.2.74.2.84.2.9 |
4.2.12 |
Show 5 moreShow less
| Package | Affected | Fixed |
|---|---|---|
cakephp/databasePackagist |
4.3.0 up to 4.3.11, plus listed versions 4.3.14.3.104.3.24.3.34.3.4 Show 5 moreShow less4.3.54.3.64.3.74.3.84.3.9 |
4.3.11 |
cakephp/databasePackagist |
4.4.0 up to 4.4.10, plus listed versions 4.4.14.4.24.4.34.4.44.4.5 Show 4 moreShow less4.4.64.4.74.4.84.4.9 |
4.4.10 |
cakephpUbuntu:Pro:16.04:LTS |
All versions, plus listed versions 2.7.2-12.8.0-12.8.0-1ubuntu0.1~esm1 |
None known |
cakephpUbuntu:20.04:LTS |
All versions, plus listed versions 2.10.11-2 |
None known |
cakephpUbuntu:22.04:LTS |
All versions, plus listed versions 2.10.11-2.12.10.24-1 |
None known |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | OSV | |
| affected | ||
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2023-22727 is a critical vulnerability (CVSS 9.8) in Cakephp, published January 17, 2023. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.90%, the 59th percentile. Fixed in cakephp/cakephp 4.2.12.
References
github.com/cakephp/cakephp/security/advisories/GHSA-6g8q-qfpv-57wp
github.com/cakephp/cakephp/commit/3f463e7084b5a15e67205ced3a622577cca7a239
bakery.cakephp.org/2023/01/06/cakephp_4211_4311_4410_released.html
nvd.nist.gov/vuln/detail/CVE-2023-22727
github.com/advisories/GHSA-6g8q-qfpv-57wp
github.com/CVEProject/cvelistV5/tree/main/cves/2023/22xxx/CVE-2023-22727.json