{"id":"CVE-2023-22727","aliases":["CVE-2023-22727","GHSA-6g8q-qfpv-57wp"],"related":[],"kind":"vulnerability","state":"published","title":"Database Query::offset() and limit() vulnerable to SQL injection in cakephp","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### 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","format":"markdown","source":"ghsa"},{"lang":"es","text":"CakePHP es un framework de desarrollo para aplicaciones web PHP. En las versiones afectadas, los métodos `Cake\\Database\\Query::limit()` y `Cake\\Database\\Query::offset()` son vulnerables a la inyección SQL si se pasan datos de solicitud de usuario sin desinfectar. Este problema se solucionó en 4.2.12, 4.3.11, 4.4.10. Se recomienda a los usuarios que actualicen. Los usuarios que no puedan actualizar pueden mitigar este problema utilizando la librería de paginación de CakePHP. La validación manual o la conversión de parámetros a estos métodos también mitigará el problema.","source":"nvd"}],"published":"2023-01-17T20:41:10.143Z","modified":"2026-09-10T03:49:50.877Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"}],"cwes":["CWE-89"],"affected":[{"ranges":[{"version":">= 4.2.0, < 4.2.12","status":"affected"},{"version":">= 4.3.0, < 4.3.11","status":"affected"},{"version":">= 4.4.0, < 4.4.10","status":"affected"}],"vendor":"cakephp","product":"cakephp","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"4.2.0","status":"affected","fixed":"4.2.12"}],"ecosystem":"Packagist","package":"cakephp/cakephp","purl":"pkg:composer/cakephp/cakephp","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"4.3.0","status":"affected","fixed":"4.3.11"}],"ecosystem":"Packagist","package":"cakephp/cakephp","purl":"pkg:composer/cakephp/cakephp","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"4.4.0","status":"affected","fixed":"4.4.10"}],"ecosystem":"Packagist","package":"cakephp/cakephp","purl":"pkg:composer/cakephp/cakephp","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"4.2.0","status":"affected","fixed":"4.2.12"}],"ecosystem":"Packagist","package":"cakephp/database","purl":"pkg:composer/cakephp/database","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"4.3.0","status":"affected","fixed":"4.3.11"}],"ecosystem":"Packagist","package":"cakephp/database","purl":"pkg:composer/cakephp/database","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"4.4.0","status":"affected","fixed":"4.4.10"}],"ecosystem":"Packagist","package":"cakephp/database","purl":"pkg:composer/cakephp/database","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"4.2.0","fixed":"4.2.12"},{"status":"affected","introduced":"4.3.0","fixed":"4.3.11"},{"status":"affected","introduced":"4.4.0","fixed":"4.4.10"}],"vendor":"cakephp","product":"cakephp","cpe":"cpe:2.3:a:cakephp:cakephp:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/cakephp/cakephp/security/advisories/GHSA-6g8q-qfpv-57wp","tags":["third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/cakephp/cakephp/commit/3f463e7084b5a15e67205ced3a622577cca7a239","tags":["patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://bakery.cakephp.org/2023/01/06/cakephp_4211_4311_4410_released.html","tags":["release-notes","vendor-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-22727","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/cakephp/cakephp","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"total","date":"2025-03-10T20:59:15.575Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2023-22727","url":"https://www.cve.org/CVERecord?id=CVE-2023-22727","licence":"CVE Terms of Use","modified":"2025-03-10T21:22:35.657Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-6g8q-qfpv-57wp","url":"https://github.com/advisories/GHSA-6g8q-qfpv-57wp","licence":"CC-BY-4.0","modified":"2026-09-10T03:49:50.877Z"},{"source":"nvd","name":"NVD","id":"CVE-2023-22727","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-22727","licence":"Public domain","modified":"2026-06-17T05:36:02.727Z"}],"updatedAt":"2026-11-25T22:58:21.623Z","epss":{"score":0.00932,"percentile":0.61712,"date":"2026-12-01T12:00:22.000Z"}}