CVE-2026-79752: CakePHP SQL Injection Vulnerability

CRITICAL
Advisory Identifier: GHSA-vjqc-q4mp-2rvf
CWE-89
Published
Advisory Summary

CVE-2026-79752 is a CRITICAL sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting CakePHP libraries in the Packagist ecosystem. The issue involves multiple methods in functionsbuilder vulnerable to sql injection. Remediation is available by upgrading affected packages to version 4.5.12, 4.6.5, 5.1.9, 5.2.14, 5.3.7.

CVE-2026-79752 at a Glance

CVE Identifier CVE-2026-79752
GHSA Identifier GHSA-vjqc-q4mp-2rvf
Severity CRITICAL
CVSS v3.1 Base Score N/A
CWE Classification CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Affected Product CakePHP
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix CVE-2026-79752

To remediate this vulnerability, upgrade all affected CakePHP dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

cakephp/database fixed: 4.5.12
Upgrade cakephp/database to 4.5.12
cakephp/database fixed: 4.6.5
Upgrade cakephp/database to 4.6.5
cakephp/database fixed: 5.1.9
Upgrade cakephp/database to 5.1.9
cakephp/database fixed: 5.2.14
Upgrade cakephp/database to 5.2.14
cakephp/database fixed: 5.3.7
Upgrade cakephp/database to 5.3.7
cakephp/cakephp fixed: 4.5.12
Upgrade cakephp/cakephp to 4.5.12
cakephp/cakephp fixed: 4.6.5
Upgrade cakephp/cakephp to 4.6.5
cakephp/cakephp fixed: 5.1.9
Upgrade cakephp/cakephp to 5.1.9
cakephp/cakephp fixed: 5.2.14
Upgrade cakephp/cakephp to 5.2.14
cakephp/cakephp fixed: 5.3.7
Upgrade cakephp/cakephp to 5.3.7
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for cakephp/database

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-79752, inspect your project dependencies for CakePHP:

inspect dependencies for cakephp/database

Analyze the terminal output to locate any version of CakePHP in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.5.12), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. In CakePHP, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact The `FunctionsBuilder::cast($field, $dataType)`, `extract($part, $expr)`, `datePart($part, $expr)`, `dateAdd($expr, $value, $unit)` methods are vulnerable to SQL injection if user controlled data is supplied to the ($dataType / $part / $unit) parameters. ### Patches 5.3.7, 5.2.14, 5.1.9, 4.6.5, 4.5.12 contain fixes ### Workarounds Don't provide user controlled data to these functions/parameters.

CVE-2026-79752 Affected CakePHP Versions

10 component(s)
Fixed Versions:
4.5.124.6.55.1.95.2.145.3.7
Product / Package Ecosystem Affected Versions Fixed Version
cakephp/database
Packagist
≥ 3.0.0
< 4.5.12
4.5.12
cakephp/database
Packagist
≥ 4.6.0
< 4.6.5
4.6.5
cakephp/database
Packagist
≥ 5.0.0
< 5.1.9
5.1.9
cakephp/database
Packagist
≥ 5.2.0
< 5.2.14
5.2.14
cakephp/database
Packagist
≥ 5.3.0
< 5.3.7
5.3.7
cakephp/cakephp
Packagist
< 4.5.12
4.5.12
cakephp/cakephp
Packagist
≥ 4.6.0
< 4.6.5
4.6.5
cakephp/cakephp
Packagist
≥ 5.0.0
< 5.1.9
5.1.9
cakephp/cakephp
Packagist
≥ 5.2.0
< 5.2.14
5.2.14
cakephp/cakephp
Packagist
≥ 5.3.0
< 5.3.7
5.3.7

References

GitHub Advisory / Wiki ADVISORY
https://github.com/cakephp/cakephp/security/advisories/GHSA-vjqc-q4mp-2rvf
NVD — CVE-2026-79752 NVD
https://nvd.nist.gov/vuln/detail/CVE-2026-79752
CakePHP Source Repository REPOSITORY
https://github.com/cakephp/cakephp/pull/19528
CakePHP Source Repository REPOSITORY
https://github.com/cakephp/cakephp/pull/19520
Security Fix Commit FIX COMMIT
https://github.com/cakephp/cakephp/commit/79e1d6bc6f3a50fa01805579076a02c77370c676
Security Fix Commit FIX COMMIT
https://github.com/cakephp/cakephp/commit/8699d6f38e25fe46fcc24f2b698809948e71ad7d
Security Fix Commit FIX COMMIT
https://github.com/cakephp/cakephp/commit/ab608711674ac662af7315c5cdf1e0fbe2000e45
Security Fix Commit FIX COMMIT
https://github.com/cakephp/cakephp/commit/4730e774bd3b9caa90d67af49e27a12033ec3c71
Security Fix Commit FIX COMMIT
https://github.com/cakephp/cakephp/commit/3f4d13ea4280067f3381ecf935a8bef5b7cdcc2e
Security Fix Commit FIX COMMIT
https://github.com/cakephp/cakephp/commit/3349584ca3a891afaff2dbc324d6b1c09fb880f0
CakePHP Release RELEASE
https://github.com/cakephp/cakephp/releases/tag/4.5.12
CakePHP Release RELEASE
https://github.com/cakephp/cakephp/releases/tag/4.6.5
CakePHP Release RELEASE
https://github.com/cakephp/cakephp/releases/tag/5.1.8
CakePHP Release RELEASE
https://github.com/cakephp/cakephp/releases/tag/5.1.9
CakePHP Release RELEASE
https://github.com/cakephp/cakephp/releases/tag/5.2.14
CakePHP Release RELEASE
https://github.com/cakephp/cakephp/releases/tag/5.3.7
CakePHP Source Repository REPOSITORY
https://github.com/cakephp/cakephp

Frequently Asked Questions

What is CVE-2026-79752?
CVE-2026-79752 is a security vulnerability in CakePHP involving Multiple methods in FunctionsBuilder vulnerable to SQL injection under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Which CakePHP versions are affected?
Affected versions include releases prior to 4.5.12, 4.6.5, 5.1.9, 5.2.14, 5.3.7 across affected packages: cakephp/database, cakephp/cakephp.
What version fixes CVE-2026-79752?
Upgrading to 4.5.12, 4.6.5, 5.1.9, 5.2.14, 5.3.7 (or the latest patched release for your respective branch) resolves the vulnerability.
Is cakephp/database affected?
Yes, cakephp/database is affected in releases prior to 4.5.12, 4.6.5, 5.1.9, 5.2.14, 5.3.7. Upgrade your dependency to 4.5.12, 4.6.5, 5.1.9, 5.2.14, 5.3.7 or later.
Is cakephp/cakephp affected?
Yes, cakephp/cakephp is affected in releases prior to 4.5.12, 4.6.5, 5.1.9, 5.2.14, 5.3.7. Upgrade your dependency to 4.5.12, 4.6.5, 5.1.9, 5.2.14, 5.3.7 or later.
What CWE is associated with CVE-2026-79752?
CVE-2026-79752 is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') (The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.).
How can I check Packagist dependencies for CVE-2026-79752?
Run the dependency tree command: 'inspect dependencies for cakephp/database'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-vjqc-q4mp-2rvf",
  "modified" : "2026-09-24T14:36:09Z",
  "published" : "2026-09-17T20:28:14Z",
  "aliases" : [ "CVE-2026-79752" ],
  "summary" : "CakePHP: Multiple methods in FunctionsBuilder vulnerable to SQL injection",
  "details" : "### Impact\nThe `FunctionsBuilder::cast($field, $dataType)`, `extract($part, $expr)`, `datePart($part, $expr)`, `dateAdd($expr, $value, $unit)` methods are vulnerable to SQL injection if user controlled data is supplied to the ($dataType / $part / $unit) parameters.\n\n### Patches\n5.3.7, 5.2.14, 5.1.9, 4.6.5, 4.5.12 contain fixes \n\n### Workarounds\nDon't provide user controlled data to these functions/parameters.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "cakephp/database"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0"
      }, {
        "fixed" : "4.5.12"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "cakephp/database"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.6.0"
      }, {
        "fixed" : "4.6.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "cakephp/database"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0.0"
      }, {
        "fixed" : "5.1.9"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "cakephp/database"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.2.0"
      }, {
        "fixed" : "5.2.14"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "cakephp/database"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.3.0"
      }, {
        "fixed" : "5.3.7"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "cakephp/cakephp"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.5.12"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "cakephp/cakephp"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.6.0"
      }, {
        "fixed" : "4.6.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "cakephp/cakephp"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0.0"
      }, {
        "fixed" : "5.1.9"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "cakephp/cakephp"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.2.0"
      }, {
        "fixed" : "5.2.14"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "cakephp/cakephp"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.3.0"
      }, {
        "fixed" : "5.3.7"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/cakephp/cakephp/security/advisories/GHSA-vjqc-q4mp-2rvf"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-79752"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cakephp/cakephp/pull/19528"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cakephp/cakephp/pull/19520"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cakephp/cakephp/commit/79e1d6bc6f3a50fa01805579076a02c77370c676"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cakephp/cakephp/commit/8699d6f38e25fe46fcc24f2b698809948e71ad7d"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cakephp/cakephp/commit/ab608711674ac662af7315c5cdf1e0fbe2000e45"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cakephp/cakephp/commit/4730e774bd3b9caa90d67af49e27a12033ec3c71"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cakephp/cakephp/commit/3f4d13ea4280067f3381ecf935a8bef5b7cdcc2e"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cakephp/cakephp/commit/3349584ca3a891afaff2dbc324d6b1c09fb880f0"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cakephp/cakephp/releases/tag/4.5.12"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cakephp/cakephp/releases/tag/4.6.5"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cakephp/cakephp/releases/tag/5.1.8"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cakephp/cakephp/releases/tag/5.1.9"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cakephp/cakephp/releases/tag/5.2.14"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cakephp/cakephp/releases/tag/5.3.7"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/cakephp/cakephp"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-89" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-17T20:28:14Z",
    "nvd_published_at" : "2026-09-17T15:16:51Z"
  }
}