PatchClock

PHP security digest · 8 Sep 2026

CakePHP: FunctionsBuilder::jsonValue() vulerable to SQL injection with PostgresDriver

Critical CVE-2026-77635

Packages
cakephp/cakephp, cakephp/database
Fixed in
5.3.7, 5.2.15, 5.1.10
Published
Tue 8 Sep 2026, 21:56 Lisbon
Installs on Packagist
21M

In plain words

An attacker can inject SQL if user-controlled data is passed to the $jsonPath parameter of FunctionsBuilder::jsonValue() when using the Postgres driver. The flaw affects both cakephp/cakephp and cakephp/database.

Affected versions

PackageAffectedFixed in
cakephp/cakephp>= 5.3.0, < 5.3.75.3.7
cakephp/cakephp>= 5.2.0, < 5.2.155.2.15
cakephp/cakephp>= 5.1.0, < 5.1.105.1.10
cakephp/database>= 5.3.0, < 5.3.75.3.7
cakephp/database>= 5.2.0, < 5.2.155.2.15
cakephp/database>= 5.1.0, < 5.1.105.1.10

Am I affected?

Check composer.lock for cakephp/cakephp or cakephp/database in any affected range: >= 5.1.0, < 5.1.10, >= 5.2.0, < 5.2.15 or >= 5.3.0, < 5.3.7. If present, check whether your project uses the Postgres driver and passes user-controlled data to the $jsonPath parameter of FunctionsBuilder::jsonValue().

What to do

Check which version you have, then update to a fixed release for your branch (5.3.7, 5.2.15, 5.1.10):

composer show cakephp/cakephp | grep versions
composer update cakephp/cakephp

If your version constraint in composer.json keeps you below a fixed release, raise it first. Whether your configuration is affected, and the exact version ranges, are in the advisory itself.

If you cannot update yet

Do not pass user-controlled data to the $jsonPath parameter of FunctionsBuilder::jsonValue().

The advisory's description

Impact

The FunctionsBuilder::jsonValue($field, $jsonPath) methods with the Postgres driver is vulnerable to SQL injection if user controlled data is supplied to the $jsonPath parameter.

Patches

5.1.10, 5.2.15, 5.3.7

Workarounds

Don't provide user controlled data to these functions/parameters.

Weakness: CWE-89 Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').

The advisory

From OSV.dev, which gathers the GitHub Advisory Database, FriendsOfPHP and Drupal security advisories; the summary is theirs. The description, affected versions, weakness and credits are from the GitHub Advisory Database (CC BY 4.0). "In plain words", "Am I affected?" and "If you cannot update yet" are based on that advisory, and checked to name no version it does not.