GHSA-vjqc-q4mp-2rvf: SQL Injection

Published Sep 17, 2026
·
Updated

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.

Affected Software

10 affected componentsFixes available
composer/cakephp/cakephp>=5.3.0<5.3.7
5.3.7
composer/cakephp/cakephp>=5.2.0<5.2.14
5.2.14
composer/cakephp/cakephp>=5.0.0<5.1.9
5.1.9
composer/cakephp/cakephp>=4.6.0<4.6.5
4.6.5
composer/cakephp/cakephp<4.5.12
4.5.12
composer/cakephp/database>=5.3.0<5.3.7
5.3.7
composer/cakephp/database>=5.2.0<5.2.14
5.2.14
composer/cakephp/database>=5.0.0<5.1.9
5.1.9
composer/cakephp/database>=4.6.0<4.6.5
4.6.5
composer/cakephp/database<4.5.12
4.5.12

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade composer/cakephp/cakephp to a version that resolves this vulnerability.

    Fixed in 5.3.7
  2. Upgrade

    Upgrade composer/cakephp/cakephp to a version that resolves this vulnerability.

    Fixed in 5.2.14
  3. Upgrade

    Upgrade composer/cakephp/cakephp to a version that resolves this vulnerability.

    Fixed in 5.1.9
  4. Upgrade

    Upgrade composer/cakephp/cakephp to a version that resolves this vulnerability.

    Fixed in 4.6.5
  5. Upgrade

    Upgrade composer/cakephp/cakephp to a version that resolves this vulnerability.

    Fixed in 4.5.12
  6. Upgrade

    Upgrade composer/cakephp/database to a version that resolves this vulnerability.

    Fixed in 5.3.7
  7. Upgrade

    Upgrade composer/cakephp/database to a version that resolves this vulnerability.

    Fixed in 5.2.14
  8. Upgrade

    Upgrade composer/cakephp/database to a version that resolves this vulnerability.

    Fixed in 5.1.9
  9. Upgrade

    Upgrade composer/cakephp/database to a version that resolves this vulnerability.

    Fixed in 4.6.5
  10. Upgrade

    Upgrade composer/cakephp/database to a version that resolves this vulnerability.

    Fixed in 4.5.12
  11. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 5.3.7
  12. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 5.2.14
  13. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 5.1.9
  14. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 4.6.5
  15. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 4.5.12
  16. Configuration

    Ensure user-controlled data is not supplied to `FunctionsBuilder::cast($field, $dataType)`, `extract($part, $expr)`, `datePart($part, $expr)`, and `dateAdd($expr, $value, $unit)`—specifically prevent user control of `$dataType`, `$part`, and `$unit` (and `$expr` where applicable).

    SQL query building / methods in `FunctionsBuilder` Input validation for parameters = No user-controlled data

Event History

Sep 17, 2026
Advisory Published
via GitHub·08:28 PM
Data Sourced
via GitHub·08:28 PM
DescriptionWeaknessAffected Software

Frequently Asked Questions

1

Which applications are exposed to this SQL injection issue?

Applications using composer/cakephp/cakephp or composer/cakephp/database are exposed when they pass user-controlled values as the data type, date part, or date-add unit arguments to the affected FunctionsBuilder methods.

2

What does an attacker need to exploit it?

An attacker needs influence over the $dataType argument of cast(), the $part argument of extract() or datePart(), or the $unit argument of dateAdd(). The issue is specifically tied to user-controlled data reaching those parameters.

3

Which versions contain fixes?

Fixes are available in versions 5.3.7, 5.2.14, 5.1.9, 4.6.5, and 4.5.12.

4

What can be done if upgrading is not immediately possible?

Do not provide user-controlled data to the affected dataType, part, or unit parameters. Ensure these arguments are selected from application-controlled values rather than directly derived from requests or other untrusted input.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203