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

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.

Published: 2023-01-17 Last update: 2026-06-17 Assigner: [email protected] Source: [email protected]

Conclusion & alert: CVE-2023-22727 is rated High Risk (65.8/100): CVSS Critical severity, with medium exploitation likelihood (EPSS 0.93%). Mandatory action: High exploitation likelihood—assess exposure and prioritize remediation.

Risk is dynamic; we continuously reassess and refresh what is shown on this page as upstream context changes.

Exploit prediction scoring system (EPSS) score for CVE-2023-22727

EPSS lead: Daily EPSS estimates relative likelihood of exploitation; percentile ranks this CVE among scored vulnerabilities (higher = more severe relative rank).

# Date Old EPSS score New EPSS score Delta (New - Old)
1 2026-01-26 0.80% 0.93% +0.13%
2 2026-01-21 0.67% 0.80% +0.13%
3 2026-01-19 0.67%

Full EPSS history (12 records total)

Common vulnerability scoring system (CVSS) metrics for CVE-2023-22727

CVSS metrics for this CVE.

Base score Version Severity Vector Exploitability Impact Score source
9.8 3.1 CRITICAL
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Availability (A:H)
Could take the service down hard or make it unusable for people who depend on it.
3.9 5.9 [email protected]
9.8 3.1 CRITICAL
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Availability (A:H)
Could take the service down hard or make it unusable for people who depend on it.
3.9 5.9 [email protected]

Weakness enumeration for CVE-2023-22727

GitHub Security Advisory for CVE-2023-22727

GHSA-6g8q-qfpv-57wp · Severity: critical · Ecosystem: composer — CakePHP Database\\Query::offset() and limit() methods are vulnerable to SQL injection

OS Trackers for CVE-2023-22727

vendor priority summary link
debian unimportant CVE-2023-22727 unimportant priority: Debian including 1 source packages (cakephp), 1 status rows across 1 suites (bullseye): resolved 1. https://security-tracker.debian.org/tracker/CVE-2023-22727
ubuntu medium CVE-2023-22727 medium priority: Ubuntu including 1 source packages (cakephp), 7 status rows across 7 suites (bionic, focal, jammy, kinetic, trusty, upstream, xenial): needs-triage 3, ignored 2, DNE 1, released 1. https://ubuntu.com/security/CVE-2023-22727

Affected software / configurations for CVE-2023-22727

Vendor Product Version Raw CPE
cakephp cakephp >= 4.2.0, < 4.2.12 cpe:2.3:a:cakephp:cakephp:*:*:*:*:*:*:*:*
cakephp cakephp >= 4.3.0, < 4.3.11 cpe:2.3:a:cakephp:cakephp:*:*:*:*:*:*:*:*
cakephp cakephp >= 4.4.0, < 4.4.10 cpe:2.3:a:cakephp:cakephp:*:*:*:*:*:*:*:*

References for CVE-2023-22727

cvelogic Threat Intelligence