CVE-2023-22727CWE-89

Database Query::offset() and limit() vulnerable to SQL injection in cakephp

Critical · published January 17, 2023

CVSS v3.1
9.8
EPSS
1%
Percentile
58.0
In the wild
Unconfirmed
What it is

🚨 A sneak peek into a critical vulnerability in CakePHP could leave your database wide open! 🔥 Think of it like leaving the windows of your bakery wide open for anyone to grab the secret recipes. If an attacker gets access to your `limit()` and `offset()` methods without proper checks, they can serve up all your sensitive data! An attacker could exploit this SQL injection vulnerability to manipulate database queries, potentially gaining access to, altering, or even deleting crucial data. Imagine the chaos of losing your most prized recipes—absolutely devastating! 🔥

Put simply

Think of it like leaving the windows of your bakery wide open for anyone to grab the secret recipes. If an attacker gets access to your `limit()` and `offset()` methods without proper checks, they can serve up all your sensitive data! The vulnerability in CakePHP lies in the `Cake\Database\Query::limit()` and `Cake\Database\Query::offset()` methods, which are susceptible to SQL injection when they receive unsanitized user input, allowing attackers to craft malicious queries.

What to do

An attacker could exploit this SQL injection vulnerability to manipulate database queries, potentially gaining access to, altering, or even deleting crucial data. Imagine the chaos of losing your most prized recipes—absolutely devastating! 🔥 Upgrade to CakePHP versions 4.2.12, 4.3.11, or 4.4.10 immediately to close this critical hole! If upgrading isn't possible, switch to CakePHP's Pagination library, or manually validate and cast parameters in your queries to mitigate the risk. 🛡️ You've got this! Take these steps to lock down your application and keep your data safe! 💪✨

The record
Technical detail
CVSS v3.1
9.8 · CRITICAL
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS v4.0
Not supplied
EPSS
0.00858 · 58.0th percentile
Weakness
CWE-89 · Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Published
2023-01-17T20:41Z
EPSS history
Timeline
  • 17 JAN 20:41Z
    Database Query::offset() and limit() vulnerable to SQL injection in cakephp
    cvelistv5