Critical

CakePHP Database\\Query::offset() and limit() methods are vulnerable to SQL injection

  • Disclosed: 20.01.2023
  • Updated: 11.10.2026 10:22

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.

PlatformPackageVulnerable versionsFixed 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

CVSS score 9.8/10
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/database

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
3
First → latest
01.2023 09.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • Critical 3

Disclosures per year

  1. 2023: 1
  2. 2024: 0
  3. 2025: 0
  4. 2026: 2
  1. Critical CVE-2026-79752 >= 3.0.0, < 4.5.12, >= 4.6.0, < 4.6.5, >= 5.0.0, < 5.1.9, >= 5.2.0, < 5.2.14, >= 5.3.0, < 5.3.7 4.5.12, 4.6.5, 5.1.9, 5.2.14, 5.3.7
  2. Critical CVE-2026-77635 >= 5.3.0, < 5.3.7, >= 5.2.0, < 5.2.15, >= 5.1.0, < 5.1.10 5.3.7, 5.2.15, 5.1.10
  3. CakePHP Database\\Query::offset() and limit() methods are vulnerable to SQL injection this entry
    Critical · 9.8 CVE-2023-22727 >= 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

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.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.