CVE-2023-22727
PHP vulnerability analysis and mitigation

Overview

CakePHP, a development framework for PHP web applications, was found to contain a critical SQL injection vulnerability (CVE-2023-22727) in its Cake\Database\Query::limit() and Cake\Database\Query::offset() methods. The vulnerability was discovered and disclosed in January 2023, affecting versions 4.2.0-4.2.11, 4.3.0-4.3.10, and 4.4.0-4.4.9. The issue occurs when these methods are passed un-sanitized user request data (GitHub Advisory, NVD).

Technical details

The vulnerability stems from insufficient input validation in the limit() and offset() methods of the Query class. Prior to the patch, these methods would accept string inputs that were not properly sanitized, potentially allowing for SQL injection attacks. The issue was assigned a CVSS v3.1 base score of 9.8 (CRITICAL), indicating its severe nature. The vulnerability is classified as CWE-89 (SQL Injection) (NVD, Security Online).

Impact

If exploited, this vulnerability could allow remote attackers to read or modify any data in the underlying database or potentially elevate their privileges through specially-crafted SQL statements. The high severity rating indicates the potential for significant data breach and system compromise (Security Online).

Mitigation and workarounds

The vulnerability has been patched in versions 4.2.12, 4.3.11, and 4.4.10. Users are strongly advised to upgrade to these or newer versions. For those unable to upgrade immediately, two workarounds are available: using CakePHP's Pagination library or manually validating/casting parameters to these methods (CakePHP Blog).

Additional resources


SourceThis report was generated using AI

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management