Skip to main content

CakePHP EUVDEUVD-2026-81673

| CVE-2026-79752 CRITICAL
SQL Injection (CWE-89)
2026-09-17 GitHub_M GHSA-vjqc-q4mp-2rvf
9.2
CVSS 4.0 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Identify endpoint feeding user input to FunctionsBuilder
  2. Delivery
    Submit malicious dataType/part/unit value
  3. Exploit
    Value spliced unescaped into SQL
  4. Execution
    Injected structural fragment executes on DB
  5. Impact
    Exfiltrate or alter data per DB privileges

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Parameterized queries, prepared statements
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Persistence

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires the CakePHP application itself to pass attacker-controllable input into the $dataType (cast), $part (extract/datePart), or $unit (dateAdd) arguments of src/Database/FunctionsBuilder.php - these are structural SQL fragments that the framework incorporated without escaping or binding prior to the fix. This is the AT:P condition in the vendor vector: the flaw does not exist in a default application that only uses these methods with hard-coded literals. Limiting factors: the vulnerable coding pattern is not idiomatic (these parameters are typed/documented as trusted structural strings, so many applications never expose them to user input); actual impact is bounded by the database connection's granted privileges; and applications on 4.5.12/4.6.5/5.1.9/5.2.14/5.3.7 or later are protected by the alphanumeric-only ensureSimpleString() guard regardless of how they call these methods.

Impact

The vendor CVSS 4.0 vector (9.2, AV:N/AC:L/AT:P/PR:N/UI:N with VC:H/VI:H/VA:H) presents this as a critical, network-reachable, unauthenticated SQL injection with full CIA impact scaled to the database account's privileges (CWE-89). The single most important nuance is the AT:P (Attack Requirements: Present) metric, which the vendor correctly set: this is NOT a flaw that fires against a default CakePHP application. Exploitation requires the *application developer* to have passed untrusted, user-controlled input directly into the dataType/part/unit structural parameters of FunctionsBuilder::cast/extract/datePart/dateAdd - parameters documented and typed as trusted structural strings, not data slots. The source diff confirms the framework never bound these values; it spliced them raw into SQL, and the fix (ensureSimpleString enforcing ^[a-zA-Z0-9]+$) is a framework-side hardening of a developer-misuse surface. No EPSS score, KEV listing, or public POC is present in the supplied intelligence, so the real-world weaponization signal is absent. Bottom line: genuinely high impact where the vulnerable coding pattern exists, but the AT:P gate means this is closer to a widespread latent-misuse defect than a universally exploitable framework hole. Whether a given deployment is exploitable depends entirely on application code, not on running an affected CakePHP version.

Exploit ScenarioDerived

A CakePHP application builds a query using FunctionsBuilder::datePart, extract, cast, or dateAdd and passes a request parameter (e.g. a user-selected 'unit' or 'dataType' from a sort/report form) straight into the part/unit/dataType argument. A remote attacker submits a value like "' DROP TABLE users --" (mirroring the test's invalidValues cases), which is concatenated unescaped into the SQL as a structural fragment, achieving injection with read/write/DoS impact limited only by the DB connection's privileges. No public exploit code is identified in the provided data, though the fix commits and PRs are public and clearly show the vulnerable sink.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
Patch available 0.5% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Sep 17, 2026

SQL injection in the CakePHP PHP framework (versions prior to 4.5.12, 4.6.5, 5.1.9, 5.2.14, and 5.3.7) allows unauthenticated remote attackers to inject arbitrary SQL when an application forwards untrusted input into the $dataType, $part, or $unit arguments of FunctionsBuilder::cast, ::extract, ::datePart, and ::dateAdd, which the framework incorporates into generated SQL as unescaped structural fragments rather than bound parameters. Successful exploitation yields high confidentiality, integrity, and availability impact bounded by the privileges of the application's database connection, as reflected in the vendor's CVSS 4.0 score of 9.2 (CWE-89); however, the attack requires the non-default precondition that the application itself passes attacker-controllable data to these trusted-structure parameters, which is not an idiomatic usage pattern. No public exploit code was identified at time of analysis and the issue is not listed in CISA KEV, though the framework's broad deployment makes prompt patching advisable.

RemediationAI

Vendor-released patches: upgrade to CakePHP 4.5.12, 4.6.5, 5.1.9, 5.2.14, or 5.3.7 depending on your maintained branch (release links: https://github.com/cakephp/cakephp/releases/tag/4.5.12, /4.6.5, /5.1.9, /5.2.14, /5.3.7; advisory: https://github.com/cakephp/cakephp/security/advisories/GHSA-vjqc-q4mp-2rvf). The fix adds an ensureSimpleString() guard in src/Database/FunctionsBuilder.php that throws InvalidArgumentException unless dataType, part, and unit match ^[a-zA-Z0-9]+$, so upgrade is effective regardless of how the application calls these methods. Where upgrading is not immediately possible, audit all call sites of FunctionsBuilder::cast(), ::extract(), ::datePart(), and ::dateAdd() and replace any user-influenced value in the $dataType, $part, or $unit positions with a fixed allow-list of literal constants (for example, mapping an expected set of values such as 'year', 'month', 'day', or 'integer' to hard-coded strings before the call); the trade-off is that legitimate dynamic formatting choices must be constrained to that allow-list, but this removes the injection primitive entirely. As a compensating control, review the database user's privileges - revoking DDL, cross-schema, and file-system rights limits the blast radius of any residual injection, since impact is bounded by the connection's grants - and consider a WAF rule rejecting SQL metacharacters (quotes, comment sequences, whitespace) in requests that reach these code paths. Note that simply escaping input at the application layer is not a reliable fix here because these arguments become query structure rather than values.

Affected VersionsENISA

cakephp 5.0.0, < 5.1.9
cakephp 5.2.0, < 5.2.14
cakephp < 4.5.12
cakephp 4.6.0, < 4.6.5
cakephp 5.3.0, < 5.3.7

Affected Packages

composer cakephp/cakephp fix: 4.5.12, 4.6.5, 5.1.9, 5.2.14, 5.3.7
composer cakephp/database fix: 4.5.12, 4.6.5, 5.1.9, 5.2.14, 5.3.7
euvd cakephp fix: 4.5.12, 4.6.5, 5.1.9, 5.2.14, 5.3.7

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 3 packages in composer, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

CakePHP is a widely used rapid-development MVC framework for PHP, and its Database layer (src/Database/FunctionsBuilder.php) constructs SQL function expressions such as CAST, EXTRACT, DATEPART, and DATEADD for the query builder. In the vulnerable builds, the dataType, part, and unit parameters are typed and documented as trusted structural strings (ExpressionInterface|string) and are concatenated directly into the emitted SQL rather than being escaped or passed as bound parameters - a classic CWE-89 improper neutralization of special elements used in an SQL command, where the defect is the absence of input validation on what the code treats as query structure. The upstream fix (GitHub pull requests 19520 and 19528, commits 3349584ca3a891afaff2dbc324d6b1c09fb880f0, 3f4d13ea4280067f3381ecf935a8bef5b7cdcc2e, 79e1d6bc6f3a50fa01805579076a02c77370c676, 8699d6f38e25fe46fcc24f2b698809948e71ad7d, and ab608711674ac662af7315c5cdf1e0fbe2000e45) introduces a protected ensureSimpleString() helper that rejects any value failing the '/^[a-zA-Z0-9]+$/' alphanumeric pattern by throwing InvalidArgumentException, and additionally tightens the docblocks across the builder to warn that ExpressionInterface|string parameters are unsafe for user-controlled data. The CPE cpe:2.3:a:cakephp:cakephp:*:*:*:*:*:*:*:* reflects that the advisory applies across the whole framework package rather than a single component.

Know when Cakephp gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (GitHub_M) PRIMARY 9.2 CRITICAL
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
vuln.today AI 8.1 HIGH

Network, unauthenticated, full CIA per DB privileges; AC:H maps the vendor's AT:P gate because exploitation depends on the application feeding untrusted input into trusted structural parameters.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
4.0 AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
Patch available
Sep 17, 2026 - 16:02 EUVD
CVE Published
Sep 17, 2026 - 14:49 cve.org
CRITICAL 9.2

DescriptionCVE.org

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.

Technical POC Analysis

CWE-89: Improper Neutralization of Special Elements used in an SQL Command.

Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.

Executive ViewAI

Why It Matters

Organizations running PHP applications built on the CakePHP framework at versions below 4.5.12, 4.6.5, 5.1.9, 5.2.14, or 5.3.7 carry a critical SQL injection exposure in the framework's SQL-function builder, where four structural argument types are concatenated into generated SQL rather than bound as parameters. Because CakePHP is a widely embedded dependency, the exposure reaches any downstream application whose own code forwards user-controllable values into those arguments - an uncommon but not impossible pattern - and where it occurs, the database connection's full privileges are available to an attacker, affecting confidentiality, integrity, and availability of the data behind that application. Leadership should treat this as a portfolio-wide dependency hygiene issue: no public exploit was identified at time of analysis and the issue is not in CISA KEV, but the breadth of deployment means the inventory and code-review work is significant even though the per-application likelihood of the unsafe pattern is low.

Business Impact: High
Compensating Controls

Apply vendor patch (upgrade to 4.5.12, 4.6.5, 5.1.9, 5.2.14, or 5.3.7) as the primary remediation; if immediate upgrade is not achievable, apply strict server-side allowlisting so only hard-coded, developer-controlled constants can reach the $dataType, $part, and $unit arguments; run affected applications under a database account limited to the minimum required privileges, avoiding schema-altering or administrative rights; deploy WAF/virtual-patching rules targeting SQL-injection patterns against routes that expose date or cast functionality; and enable database query logging and anomaly alerting to detect structural SQL manipulation attempts.

Threat Intelligence Overview

EPSS Score
0.5%
Top 61% exploitable
Prevalence
Medium
popular PHP MVC framework, widely used but not WordPress/Linux-scale ubiquity
Threat Intel
1
1 source
Data Quality
6 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA GitHub

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC No
EPSS 0.5%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

46
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +46
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

SQL injection exploits the way applications construct database queries by mixing user input directly into SQL statements.

CVE-2012-4399 HIGH POC
7.5 Oct 09

The Xml class in CakePHP 2.1.x before 2.1.5 and 2.2.x before 2.2.1 allows remote attackers to read arbitrary files via X

CVE-2016-4793 HIGH POC
7.5 Jan 23

The clientIp function in CakePHP 3.2.4 and earlier allows remote attackers to spoof their IP via the CLIENT-IP HTTP head

CVE-2015-8379 HIGH POC
8.8 Jan 26

CakePHP 2.x and 3.x before 3.1.5 might allow remote attackers to bypass the CSRF protection mechanism via the _method pa

CVE-2023-22727 CRITICAL
9.8 Jan 17

CakePHP is a development framework for PHP web apps. Rated critical severity (CVSS 9.8), this vulnerability is remotely

CVE-2026-77635 CRITICAL
9.2 Aug 24

SQL injection in CakePHP's database layer allows attackers to inject arbitrary SQL when an application uses FunctionsBui

CVE-2026-77337 CRITICAL
9.1 Aug 24

Authentication bypass in the CakePHP Authentication plugin's CookieAuthenticator (versions before 2.11.2, 3.0.0-3.3.6, a

CVE-2026-77634 HIGH
8.2 Aug 24

Email header injection in CakePHP's Mailer component allows CRLF sequences embedded in custom header values to split SMT

CVE-2019-11458 HIGH
7.5 May 08

An issue was discovered in SmtpTransport in CakePHP 3.7.6. Rated high severity (CVSS 7.5), this vulnerability is remotel

CVE-2026-48820 MEDIUM
6.3 Jun 17

Local file inclusion in CakePHP's View::_getElementFileName() allows remote attackers to include arbitrary PHP files fro

CVE-2026-23643 MEDIUM
5.4 Jan 16

CakePHP versions prior to 5.2.12 and 5.3.1 contain a stored cross-site scripting vulnerability in the PaginatorHelper::l

CVE-2020-15400 MEDIUM
4.3 Jun 30

CakePHP before 4.0.6 mishandles CSRF token generation. Rated medium severity (CVSS 4.3), this vulnerability is remotely

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy