Skip to content
OpenAdvisories
Critical · 9.8 CVE-2023-22727 EUVD-2023-0361GHSA-6g8q-qfpv-57wp

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

Published Jan 17, 2023 · Updated Mar 10, 2025 · Assigned by GitHub_M

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 products

VendorProductAffectedFixed
cakephp cakephp >= 4.2.0, < 4.2.12, >= 4.3.0, < 4.3.11, >= 4.4.0, < 4.4.10 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Ubuntu 22.04 LTS cakephp No fix yet —
Ubuntu 20.04 LTS cakephp No fix yet —
Show 1 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu Pro 16.04 LTS cakephp No fix yet —

Affected packages

EcosystemPackageAffectedFixedRecord
Packagist cakephp/cakephp >= 4.2.0, < 4.2.12 4.2.12 GHSA-6g8q-qfpv-57wp
Packagist cakephp/cakephp >= 4.3.0, < 4.3.11 4.3.11 GHSA-6g8q-qfpv-57wp
Packagist cakephp/cakephp >= 4.4.0, < 4.4.10 4.4.10 GHSA-6g8q-qfpv-57wp
Packagist cakephp/database >= 4.2.0, < 4.2.12 4.2.12 GHSA-6g8q-qfpv-57wp
Packagist cakephp/database >= 4.3.0, < 4.3.11 4.3.11 GHSA-6g8q-qfpv-57wp
Packagist cakephp/database >= 4.4.0, < 4.4.10 4.4.10 GHSA-6g8q-qfpv-57wp

References