Every CVE Search/ Get API key

CVE-2023-22727

Database Query::offset() and limit() vulnerable to SQL injection in cakephp

9.8 CriticalFix available

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

0.90%Down 0.1 points since Jan 18, 2023
90%50%10%1%

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 CriticalCVSS: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 CriticalCVSS: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 CriticalCVSS: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 CriticalCVSS: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 CriticalCVSS: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 CriticalCVSS: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 CriticalCVSS: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 CriticalCVSS: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

Affected packages
PackageAffectedFixed
cakephp/cakephp
Packagist
4.2.0 up to 4.2.12
4.2.12
cakephp/cakephp
Packagist
4.3.0 up to 4.3.11
4.3.11
cakephp/cakephp
Packagist
4.4.0 up to 4.4.10
4.4.10
cakephp/database
Packagist
4.2.0 up to 4.2.12
4.2.12
cakephp/database
Packagist
4.3.0 up to 4.3.11
4.3.11
cakephp/database
Packagist
4.4.0 up to 4.4.10
4.4.10
cakephp/cakephp
Packagist
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 less
4.2.44.2.54.2.64.2.74.2.84.2.9
4.2.12
cakephp/cakephp
Packagist
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 less
4.3.54.3.64.3.74.3.84.3.9
4.3.11
cakephp/cakephp
Packagist
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 less
4.4.64.4.74.4.84.4.9
4.4.10
cakephp/database
Packagist
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 less
4.2.44.2.54.2.64.2.74.2.84.2.9
4.2.12
Show 5 moreShow less
Affected packages
PackageAffectedFixed
cakephp/database
Packagist
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 less
4.3.54.3.64.3.74.3.84.3.9
4.3.11
cakephp/database
Packagist
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 less
4.4.64.4.74.4.84.4.9
4.4.10
cakephp
Ubuntu:Pro:16.04:LTS
All versions, plus listed versions
2.7.2-12.8.0-12.8.0-1ubuntu0.1~esm1
None known
cakephp
Ubuntu:20.04:LTS
All versions, plus listed versions
2.10.11-2
None known
cakephp
Ubuntu:22.04:LTS
All versions, plus listed versions
2.10.11-2.12.10.24-1
None known

History

History
RecordedChangedSources
affected, factsOSV
affected
first indexedCVE 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

Show 4 moreShow less
MoveEnter Open