{"id":"GHSA-6g8q-qfpv-57wp","aliases":["CVE-2023-22727"],"title":"CakePHP Database\\\\Query::offset() and limit() methods are vulnerable to SQL injection","titleSource":"OSV","descriptionSource":"OSV","declaredSeverity":"CRITICAL","description":"### Impact\n\nThe `Cake\\Database\\Query::limit()` and `Cake\\Database\\Query::offset()` methods are vulnerable to SQL injection if passed un-sanitized user request data.\n\n### Patches\nThis issue has been fixed in 4.2.12, 4.3.11, 4.4.10\n\n### Workarounds\n\nUsing CakePHP's Pagination library will mitigate this issue, as will validating or casting parameters to these methods.\n\n### References\n\nhttps://bakery.cakephp.org/2023/01/06/cakephp_4211_4311_4410_released.html\n","severity":"critical","score":9.8,"published":"2023-01-20T17:30:20.000Z","modified":"2026-09-10T03:49:50.877Z","withdrawn":false,"knownExploited":false,"affected":[{"ecosystem":"Packagist","name":"cakephp/cakephp","sources":[{"name":"OSV · GHSA-6g8q-qfpv-57wp","url":"https://osv.dev/vulnerability/GHSA-6g8q-qfpv-57wp"}],"ranges":[{"events":[{"introduced":"4.2.0"},{"fixed":"4.2.12"}],"type":"ECOSYSTEM"}],"versions":["4.2.0","4.2.1","4.2.10","4.2.11","4.2.2","4.2.3","4.2.4","4.2.5","4.2.6","4.2.7","4.2.8","4.2.9"],"fixed":["4.2.12"]},{"ecosystem":"Packagist","name":"cakephp/cakephp","sources":[{"name":"OSV · GHSA-6g8q-qfpv-57wp","url":"https://osv.dev/vulnerability/GHSA-6g8q-qfpv-57wp"}],"ranges":[{"events":[{"introduced":"4.3.0"},{"fixed":"4.3.11"}],"type":"ECOSYSTEM"}],"versions":["4.3.0","4.3.1","4.3.10","4.3.2","4.3.3","4.3.4","4.3.5","4.3.6","4.3.7","4.3.8","4.3.9"],"fixed":["4.3.11"]},{"ecosystem":"Packagist","name":"cakephp/cakephp","sources":[{"name":"OSV · GHSA-6g8q-qfpv-57wp","url":"https://osv.dev/vulnerability/GHSA-6g8q-qfpv-57wp"}],"ranges":[{"events":[{"introduced":"4.4.0"},{"fixed":"4.4.10"}],"type":"ECOSYSTEM"}],"versions":["4.4.0","4.4.1","4.4.2","4.4.3","4.4.4","4.4.5","4.4.6","4.4.7","4.4.8","4.4.9"],"fixed":["4.4.10"]},{"ecosystem":"Packagist","name":"cakephp/database","sources":[{"name":"OSV · GHSA-6g8q-qfpv-57wp","url":"https://osv.dev/vulnerability/GHSA-6g8q-qfpv-57wp"}],"ranges":[{"events":[{"introduced":"4.2.0"},{"fixed":"4.2.12"}],"type":"ECOSYSTEM"}],"versions":["4.2.0","4.2.1","4.2.10","4.2.11","4.2.2","4.2.3","4.2.4","4.2.5","4.2.6","4.2.7","4.2.8","4.2.9"],"fixed":["4.2.12"]},{"ecosystem":"Packagist","name":"cakephp/database","sources":[{"name":"OSV · GHSA-6g8q-qfpv-57wp","url":"https://osv.dev/vulnerability/GHSA-6g8q-qfpv-57wp"}],"ranges":[{"events":[{"introduced":"4.3.0"},{"fixed":"4.3.11"}],"type":"ECOSYSTEM"}],"versions":["4.3.0","4.3.1","4.3.10","4.3.2","4.3.3","4.3.4","4.3.5","4.3.6","4.3.7","4.3.8","4.3.9"],"fixed":["4.3.11"]},{"ecosystem":"Packagist","name":"cakephp/database","sources":[{"name":"OSV · GHSA-6g8q-qfpv-57wp","url":"https://osv.dev/vulnerability/GHSA-6g8q-qfpv-57wp"}],"ranges":[{"events":[{"introduced":"4.4.0"},{"fixed":"4.4.10"}],"type":"ECOSYSTEM"}],"versions":["4.4.0","4.4.1","4.4.2","4.4.3","4.4.4","4.4.5","4.4.6","4.4.7","4.4.8","4.4.9"],"fixed":["4.4.10"]}],"sourceAffected":[],"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"],"sources":[{"name":"OSV","id":"GHSA-6g8q-qfpv-57wp","modified":"2026-09-10T03:49:50.877561014Z","url":"https://osv.dev/vulnerability/GHSA-6g8q-qfpv-57wp"}],"assessments":[{"source":"OSV","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8}],"products":[],"remediation":[],"kev":{"status":"not-listed","checkedAt":"2026-10-28T19:25:35.956Z"},"coverage":[{"source":"NVD","status":"not-checked"},{"source":"GHSA","status":"not-checked"},{"source":"EUVD","status":"not-checked"},{"source":"EPSS","status":"not-checked"}],"evidence":[]}