# CVE-2023-22727: CakePHP Database\\Query::offset() and limit() methods are vulnerable to SQL injection

Source: https://junglewise.ai/threats/cve-2023-22727-cakephp-database-query-offset-and-limit-methods-are-vulnerable-to  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2023-01-20  
License: CC BY 4.0 with a link back

CVE-2023-22727 · Severity: low · CVSS 3.1 · Published 2023-01-20

CakePHP Database\\Query::offset() and limit() methods are vulnerable to SQL injection

Technologies: [cakephp/cakephp (Packagist)](https://junglewise.ai/threats/technologies/cakephp-cakephp), [cakephp/database (Packagist)](https://junglewise.ai/threats/technologies/cakephp-database). Vendors: [Packagist](https://junglewise.ai/threats/vendors/packagist).

## Quick answers

**Is CVE-2023-22727 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2023-22727 being exploited in the wild.

**How severe is CVE-2023-22727?** Low severity, with a CVSS score of 3.1, published 20 January 2023.

**Which products and versions are affected?** cakephp/cakephp (Packagist) ECOSYSTEM:introduced=4.2.0,fixed=4.2.12; cakephp/database (Packagist) ECOSYSTEM:introduced=4.2.0,fixed=4.2.12.

**Is there a fix for CVE-2023-22727?** Yes. cakephp/cakephp (Packagist): upgrade to 4.2.12 or later; cakephp/database (Packagist): upgrade to 4.2.12 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**Am I affected by CVE-2023-22727?** Check whether you run cakephp/cakephp (Packagist) or cakephp/database (Packagist) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- cakephp/cakephp (Packagist): upgrade to 4.2.12 or later

  ```sh
  composer require cakephp/cakephp:^4.2.12
  ```

- cakephp/database (Packagist): upgrade to 4.2.12 or later

  ```sh
  composer require cakephp/database:^4.2.12
  ```


## Affected products

- cakephp/cakephp (Packagist) ECOSYSTEM:introduced=4.2.0,fixed=4.2.12
- cakephp/database (Packagist) ECOSYSTEM:introduced=4.2.0,fixed=4.2.12

## Identifiers

- CVE-2023-22727
- GHSA-6g8q-qfpv-57wp

## Related threats

- [CakePHP FunctionsBuilder SQL injection in multiple methods](https://junglewise.ai/threats/cve-2026-79752-cakephp-functionsbuilder-sql-injection-in-multiple-methods)
- [CakePHP FunctionsBuilder::jsonValue SQL injection with PostgresDriver](https://junglewise.ai/threats/cve-2026-77635-cakephp-functionsbuilder-jsonvalue-sql-injection-with)
- [CakePHP SmtpTransport CRLF header injection](https://junglewise.ai/threats/cve-2026-77634-cakephp-smtptransport-crlf-header-injection)
- [CakePHP path traversal and file inclusion in View component](https://junglewise.ai/threats/cve-2026-48820-cakephp-path-traversal-and-file-inclusion-in-view-component)
- [CakePHP PaginatorHelper::limitControl() vulnerable to reflected cross-site-scripting](https://junglewise.ai/threats/cve-2026-23643-cakephp-paginatorhelper-limitcontrol-vulnerable-to-reflected)
