Skip to main content
Blue Moose logo Blue Moose Field notes
← All articles
craft cms

Two High-severity Craft bugs, fixed by 5.11.5

Abstract circuit board close-up

Craft's 5.11.4 and 5.11.5 releases fixed two High-severity bugs that share a theme: a check that looked at the wrong thing. One is an SQL injection reachable by any logged-in account, the other a class-instantiation bypass that can end in remote code execution. Both advisories were published on November 2, 2026, and neither has a CVE assigned as of writing.

GHSA-cphx-cx67-jcqj: SQL injection through findOne()

According to the advisory, Element::findOne() accepts a criteria array, and several controllers pass a request parameter straight into it without an integer cast. If you send that parameter as a nested array, you end up setting the query's public where property to ['AND', '<raw SQL>']. Yii's query builder treats string operands as raw SQL, so the attacker's string lands in the WHERE clause.

The affected range is 5.0.0 up to but not including 5.11.5. The reachable endpoints listed are:

  • actions/users/delete-address and actions/users/save-address: any logged-in user, no permission needed
  • actions/assets/preview-thumb and actions/assets/show-in-folder: requires accessCp

The part I find nasty is ordering. The injection runs before the ownership and permission checks (canSave(), canDelete()), so the checks never get a chance to refuse. A zero-permission account is enough, and if users.allowPublicRegistration is on, an attacker can register one. The advisory says blind boolean or time-based techniques can read database contents. It also notes that GHSA-mjj9-pjh4-r48g fixed a similar issue in 5.11.2 on the eager-loading path, and this findOne() path was missed by that fix.

GHSA-hq78-cm2m-h24h: the isset() guard

The second advisory covers 5.0.0 up to but not including 5.11.4. craft\helpers\ImageTransforms::normalizeTransform() tries to stop attacker-supplied transform arrays from choosing the PHP class. Both that guard and the later Craft::createObject() check use isset(), and isset() returns false for a key whose value is null.

So an attacker passes 'class' => null next to a '__class' key naming the target class. The guard sees no class, the array spread overwrites the intended ImageTransform, and Yii gives __class precedence. Any autoloadable class can then be instantiated with attacker-controlled properties.

The advisory's Commerce vector: the signed redirect parameter in payments/pay is rendered as a sandboxed Order object template, with an example payload of {{customer.photo.getUrl(<attacker transform>,true)}}. That needs a public site user with a profile photo. The advisory says an unauthenticated attacker can execute PHP "in the right circumstances" but doesn't define them, so I'm not going to guess at how easy this is in practice.

What I'd do

Neither advisory lists a workaround, so the answer is to upgrade. Moving to 5.11.5 covers both, since it's later than 5.11.4. Run composer update craftcms/cms, confirm the version in the control panel, and don't forget staging copies that sit on a public URL.

The interesting lesson to me is less about Craft than about the pattern. isset() as a security guard and "cast it to int before it hits a query" are both habits that fail quietly when input has an unexpected shape. If you maintain your own Yii or Drupal code, grep for places where request input flows into a criteria array or a config array before validation. That is the kind of bug a second look finds.

BM
Blue Moose
The moose behind Blue Moose. Full-stack PHP developer — Drupal by day, Symfony by night, tests always.