cakephp/cakephp security advisory
CVE-2026-79752: CakePHP: Multiple methods in FunctionsBuilder vulnerable to SQL injection
CVE-2026-79752 is a critical-severity SQL injection vulnerability in the PHP package cakephp/cakephp (CVSS 9.2), published 17 September 2026. It is fixed in 4.5.12, 4.6.5, 5.1.9, 5.2.14 and 5.3.7, one per release line; earlier versions on each line are affected. It can be exploited without an account.
critical 9.2 published 2026-09-17 · updated 2026-09-30
- Affected versions
- < 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 - Fixed in
- 4.5.12, 4.6.5, 5.1.9, 5.2.14, 5.3.7
- Newest release
- 5.4.4
- Severity
- Critical · CVSS 9.2
- Type
- SQL injection
CWE-89 - Exploited in the wild
- Not on the CISA KEV list
checked 2026-11-04
Is your cakephp/cakephp version affected?
Who can exploit CVE-2026-79752
- Access: No account. Anyone who can send a request to an app that uses the affected code.
- Conditions: It only works under specific conditions the attacker does not fully control (CVSS rates the attack as high complexity).
CVSS vector (scored by GitHub): CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
How to fix CVE-2026-79752 in cakephp/cakephp
- Find the installed version:
composer show cakephp/cakephp. If you never required it yourself,composer why cakephp/cakephpshows which package pulls it in. - Update it:
composer update cakephp/cakephp --with-all-dependencies. You need the fixed version for your release line (4.5.12, 4.6.5, 5.1.9, 5.2.14 and 5.3.7). - If Composer will not go that high, your composer.json constraint is holding it back. Widen it (for example
"cakephp/cakephp": "^5.3.7"if you can take that version), or upgrade the package that requires it. - Run
composer audit. It reads the same advisory data and should no longer list CVE-2026-79752. - Commit composer.lock and deploy it. On the server, run
composer install --no-devfrom the lock file, notcomposer update.
If you cannot upgrade yet
- Make sure user input never reaches the affected query builder or ORM method unvalidated; allow-list column and sort names.
- Give the app's database user only the permissions it needs.
- If your app does not use the affected feature, note that in your audit, but still plan the upgrade.
The CVE-2026-79752 advisory
CakePHP is a rapid development framework for PHP. Prior to 4.5.12, 4.6.5, 5.1.9, 5.2.14, and 5.3.7, FunctionsBuilder::cast, FunctionsBuilder::extract, FunctionsBuilder::datePart, and FunctionsBuilder::dateAdd in src/Database/FunctionsBuilder.php accept user-controlled dataType, part, or unit values and incorporate them into generated SQL as unescaped structural fragments. An application that passes untrusted input to these parameters can permit SQL injection with confidentiality, integrity, and availability impact according to the database connection's privileges. This issue is fixed in versions 4.5.12, 4.6.5, 5.1.9, 5.2.14, and 5.3.7.
References
- GitHub advisory GHSA-vjqc-q4mp-2rvf github.com
- Fix commit 3349584 github.com
- Fix commit 3f4d13e github.com
- Fix commit 79e1d6b github.com
- Fix commit 8699d6f github.com
- Fix commit ab60871 github.com
- Pull request #19520 github.com
- Pull request #19528 github.com
Other cakephp/cakephp advisories
- critical CVE-2026-77635: CakePHP: FunctionsBuilder::jsonValue() vulerable to SQL injection with PostgresDriver 2026-09-08
- high CVE-2026-77634: CakePHP: SmtpTransport vulnerable to CRLF header injection 2026-09-08
- medium CVE-2026-48820: CakePHP: View::element() is missing a path containment check 2026-06-26
- medium CVE-2026-23643: CakePHP PaginatorHelper::limitControl() vulnerable to reflected cross-site-scripting 2026-01-16
- critical CVE-2023-22727: CakePHP Database\\Query::offset() and limit() methods are vulnerable to SQL injection 2023-01-20
- high CVE-2020-35239: CakePHP allows method override parameters to bypass CSRF checks 2022-05-24
Related
Need help patching or upgrading? Laskyr does PHP and Laravel security fixes and upgrades. Tell us what you run and we reply with a plan and a price.
Ask about a fixWhere this data comes from
- Affected and fixed versions: the Packagist security advisories API (GitHub Advisory Database and FriendsOfPHP), the same data
composer audituses. Synced 2026-11-03. - Description, score, weakness and references: NIST National Vulnerability Database (NVD), checked 2026-11-04. This product uses data from the NVD API but is not endorsed or certified by the NVD.
- Exploited-in-the-wild status: the CISA Known Exploited Vulnerabilities catalog, checked 2026-11-04.
- Compiled by Daniel Lasek at Laskyr from the sources above. The summary, “who can exploit it”, “how to fix it” and hardening sections are our plain-English reading of the record and are generated from it. The quoted description is the record's own text. Spot an error? Tell us.