VDB
Sign up
CRITICAL

GHSA-vjqc-q4mp-2rvf

CakePHP: Multiple methods in FunctionsBuilder vulnerable to SQL injection

Quick fix

GHSA-vjqc-q4mp-2rvf — cakephp/database: upgrade to the fixed version with the command below.

composer require cakephp/database:^4.5.12

Details

### 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.

Are you affected?

Enter the version of the package you're using.

Affected packages

Packagist/cakephp/database
Introduced in: 0Fixed in: 4.5.12
Fixcomposer require cakephp/database:^4.5.12
Packagist/cakephp/database
Introduced in: 4.6.0Fixed in: 4.6.5
Fixcomposer require cakephp/database:^4.6.5
Packagist/cakephp/database
Introduced in: 5.0.0Fixed in: 5.1.9
Fixcomposer require cakephp/database:^5.1.9
Packagist/cakephp/database
Introduced in: 5.2.0Fixed in: 5.2.14
Fixcomposer require cakephp/database:^5.2.14
Packagist/cakephp/database
Introduced in: 5.3.0Fixed in: 5.3.7
Fixcomposer require cakephp/database:^5.3.7
Packagist/cakephp/cakephp
Introduced in: 0Fixed in: 4.5.12
Fixcomposer require cakephp/cakephp:^4.5.12
Packagist/cakephp/cakephp
Introduced in: 4.6.0Fixed in: 4.6.5
Fixcomposer require cakephp/cakephp:^4.6.5
Packagist/cakephp/cakephp
Introduced in: 5.0.0Fixed in: 5.1.9
Fixcomposer require cakephp/cakephp:^5.1.9
Packagist/cakephp/cakephp
Introduced in: 5.2.0Fixed in: 5.2.14
Fixcomposer require cakephp/cakephp:^5.2.14
Packagist/cakephp/cakephp
Introduced in: 5.3.0Fixed in: 5.3.7
Fixcomposer require cakephp/cakephp:^5.3.7

References