# CVE-2023-22727: Database Query::offset() and limit() vulnerable to SQL injection in cakephp

- Severity: Critical 9.8 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.93%, higher than 61% of CVEs (2026-12-01)
- Published: 2023-01-17T20:41:10.143Z
- Modified: 2026-09-10T03:49:50.877Z
- Also known as: GHSA-6g8q-qfpv-57wp
- Weaknesses: CWE-89
- SSVC (CISA-ADP): exploitation none, automatable yes, technical impact total
- 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.

(As written by CVE List.)

## Affected

- cakephp cakephp: >= 4.2.0, < 4.2.12; >= 4.3.0, < 4.3.11; >= 4.4.0, < 4.4.10; from 4.2.0 before 4.2.12; from 4.3.0 before 4.3.11; from 4.4.0 before 4.4.10
- cakephp/cakephp (Packagist): from 4.2.0 before 4.2.12; from 4.3.0 before 4.3.11; from 4.4.0 before 4.4.10
- cakephp/database (Packagist): from 4.2.0 before 4.2.12; from 4.3.0 before 4.3.11; from 4.4.0 before 4.4.10

## Every score

- GitHub_M: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- GitHub: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`

## References

- <https://github.com/cakephp/cakephp/security/advisories/GHSA-6g8q-qfpv-57wp> (third-party-advisory, web)
- <https://github.com/cakephp/cakephp/commit/3f463e7084b5a15e67205ced3a622577cca7a239> (patch, third-party-advisory, web)
- <https://bakery.cakephp.org/2023/01/06/cakephp_4211_4311_4410_released.html> (release-notes, vendor-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2023-22727> (advisory)
- <https://github.com/cakephp/cakephp> (package)

## Sources

- CVE List: [CVE-2023-22727](https://www.cve.org/CVERecord?id=CVE-2023-22727), CVE Terms of Use, modified 2025-03-10
- GitHub Advisory Database: [GHSA-6g8q-qfpv-57wp](https://github.com/advisories/GHSA-6g8q-qfpv-57wp), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2023-22727](https://nvd.nist.gov/vuln/detail/CVE-2023-22727), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2023-22727 · Whole record: https://cve.day/CVE-2023-22727.json · Rebuilt by cve.day 2026-11-25T22:58:21.623Z
