When maintaining business systems built with CakePHP, you might decide to postpone framework updates and "bundle them into the next scheduled update." The 5.4.5, 5.3.9, 5.2.17 and 4.6.7 releases on November 22 give reason to reconsider that decision, because they include five fixes for weaknesses that the fix commits and release notes describe as leading to XSS, SQL injection and header injection.
However, all five apply only when code passes values received from users directly to specific framework features. Once you know which patterns are affected, you can audit your own code in a short time.
In this article, we lay out the November 22 fix commits and release notes together with the affected code patterns. We also cover two advisories for TwigView (a plugin for using Twig templates in CakePHP). As of 1:00 (UTC) on November 26, the five advisories (GHSA) for the CakePHP core had not appeared in either the cakephp/cakephp repository or the GitHub Advisory Database. The release notes say they will be published once CVE numbers are assigned: "Security advisories will be released in the future as they are assigned CVE numbers." If you are waiting for vulnerability scanner or Dependabot notifications, you may not notice this update.
Five issues fixed in four versions on November 22
According to Packagist, 5.4.5 was released at 18:48 (UTC) on November 22, 5.3.9 at 19:09, 5.2.17 at 19:13 and 4.6.7 at 19:21. The release notes state, "The security fixes have also been released as 5.2.17, 5.3.9, and 4.6.7." The previous versions (5.4.4, 5.3.8, 5.2.16 and 4.6.6) were all released on November 1.
| Fix (commit subject) | Type | Affected code pattern | 5.4.5 | 5.3.9 and 5.2.17 | 4.6.7 |
|---|---|---|---|---|---|
| Fix missing HTML escaping for checkbox values | XSS | Putting user-supplied values into a checkbox's value | Available | Available | Available |
| Fix weakness in multicheckbox form inputs | XSS | Putting user-supplied values into the group labels (array keys) of multiCheckbox | Available | Available | Available |
| Address weakness in WindowExpression and StringAggExpression | SQL injection | Passing user-supplied values as arrays to window function methods such as partition() and orderBy() (order() in 4.x) | Available | WindowExpression only | WindowExpression only |
| Add validation to WindowExpression::frame() | SQL injection | Passing user-supplied values to the type argument of frame() | Available | Available | Available |
| Fix header injection weakness to Http\Client requests | Header injection | Putting user-supplied values into the headers of a Http\Client request | Available | Available | Available |
According to the commit messages, four of the issues were reported by Duy Tuan and the HTTP client issue by Graham Campbell. In 5.3.9, 5.2.17 and 4.6.7, only the StringAggExpression fix is missing. The backport commit gives the reason: "StringAgg only exists in 5.4+."
Note that the 4.6.7 section of the release notes lists the StringAggExpression fix but does not list the frame() and HTTP client fixes. The commits in the 4.6.7 tag include the frame() and HTTP client fixes, and there is no StringAggExpression file. The table follows the commits.
According to "Supported Versions" in the official CakePHP documentation (updated November 2026), 5.4 is under active support, while 5.3 and 5.2 are in a period where they receive only security fixes. 4.6 will continue to receive fixes until 6.0 is released, and security support for 4.4 and 4.5 ended on September 9, 2026. No fixed versions have been released for the 5.1 branch or the 4.5 branch and earlier.

What the five issues are and which code is affected
Form checkboxes (XSS, 2 issues)
The first is CheckboxWidget. The commit message reads: “If user controlled data was provided to checkbox value attributes, HTML content would not be escaped enabling reflected/stored XSS.” The fix adds a default value of 'escape' => true to this widget. The release notes also list checkboxes rendered with FormHelper::control() as affected.
The second is MultiCheckboxWidget, which concerns the labels of grouped checkboxes. The array keys become the labels, and before the fix they were output without escaping. After the fix, they are passed through h() when escape is enabled.
Affected code looks like the following, for example (example by the editorial team).
// 利用者が登録したカテゴリ名をグループの見出しにしている
$options = [];
foreach ($categories as $c) {
$options[$c->name] = $c->tags; // $c->name が見出しになる
}
echo $this->Form->multiCheckbox('tags', $options);
One example that fits is an admin screen where users can register category or tag names, and a page that lists them as checkboxes.
Building window functions (SQL injection, 2 issues)
WindowExpression is the component for building clauses like ROW_NUMBER() OVER (PARTITION BY ... ORDER BY ...) with the query builder. According to the commit, the string form was already validated, but the array form had been left out (“While the string forms of these methods have been patched, there was also a weaknesses in the array form.”). After the fix, each array element is also checked (ensureSimpleString) to allow only alphanumerics, _ and .. In 5.x, order() is deprecated, and orderBy() goes through the same check.
The other issue concerns the type argument of frame(). The commit says “Don’t allow arbitrary strings in the $type parameter as it can create a SQL injection vulnerability.” After the fix, passing anything other than ROWS, RANGE or GROUPS throws an exception.
Affected code is code that passes a sort column or an aggregation unit from request values directly into a window function.
There is one more caveat for 4.x. Validation of the string form landed in 5.x with 5.4.4, 5.3.8 and 5.2.16 on November 1, but the backport to 4.x was missed and only landed in 4.6.7 (commit b02ee79, “I missed these when backporting fixes from 5.x”). In this commit's tests, code written as range("'1 day'", "'10 days'") was rewritten to pass new QueryExpression("'1 day'"). Our editorial reading of the validation regex is that code passing a string containing spaces directly to range() will throw an exception after upgrading to 4.6.7 (we have not verified this behavior).
HTTP client headers (1 issue)
When calling an external API with Cake\Http\Client, if an outgoing header value contained line breaks (\r or \n), another header could be injected. After the fix, Request::addHeaders() strips line breaks from the value. The tests confirm that "one\r\ntwo\r\n" becomes onetwo. According to the commit, setMessage() intentionally still allows arbitrary values.
Affected code is processing that puts user input, such as search keywords, into a header and forwards it to an external API.
Two TwigView advisories (fixed versions already released in June)
On November 24, two cakephp/twig-view advisories were added to GitHub's advisory database. In the cakephp/twig-view repository, the same two were published on July 3. The fixed versions, 2.1.2 (for CakePHP 5) and 1.3.3 (for CakePHP 4), were released on Packagist on June 20 and June 21, respectively. The fixed versions and the repository publication were done over the summer, and there was a gap of about five months before the advisories appeared in the database.
| Advisory | Severity | Description and workaround (as stated in the advisory) |
|---|---|---|
| GHSA-hq9r-72jq-2pxp(CVE-2026-59191) | Moderate | If unvalidated user values are passed to FileLoader::findTemplate(), arbitrary files can be read. Workaround: “Don’t supply user controlled data to include and extends tags.” |
| GHSA-48qj-5wxh-m8hc(CVE-2026-59192) | Moderate | The unserialize filter deserializes any class. Workaround: “Don’t use the unserialize filter.” |
The second fix comes with a compatibility caveat. The advisory says: “The fix may impact backwards compatibility if you are relying on deserializing PHP objects in your templates.” In the fix commit, the unserialize filter now deserializes with allowed_classes => false, and together with serialize it has been deprecated (using it raises a warning). Pages that deserialize objects inside templates may render differently after the update.
Steps to check (editorial suggestion)
- Check the versions you use. Use
composer show cakephp/cakephp cakephp/twig-viewto see whether you are on a version earlier than 5.4.5, 5.3.9, 5.2.17 or 4.6.7, or earlier than TwigView 2.1.2 or 1.3.3 - Search for affected patterns. Use the following expressions to list candidates, and check one by one whether user values can reach them. If you find window function candidates, also check the values passed to
orderBy()andorder()around them
grep -rnE "multiCheckbox\(|->checkbox\(|'multiple' => 'checkbox'|'type' => 'checkbox'|'escape' => false" templates/ src/
grep -rnE -e "->(over|window|partition|frame|range)\(|rowNumber\(|stringAgg\(" src/
grep -rnE "new Client\(|Http\\\\Client|'headers' =>" src/
grep -rnE "\|\s*unserialize|\{%\s*(include|extends)\s+[a-z_]" templates/
- Update, then run tests and check the screens. Move 5.4 to 5.4.5, 5.3 to 5.3.9, 5.2 to 5.2.17 and 4.6 to 4.6.7. Upgrade TwigView to 2.1.2 or 1.3.3 and check how pages using
unserializerender. If you are on 5.1 or on 4.5 or earlier, no fixed versions have been released, so plan a migration to a series that is still supported - Review places where
'escape' => falseis specified. This fix only takes effect whenescapeis enabled. Where it has been disabled to output raw HTML, make sure no user values get in
Scope of verification
On November 25, 2026, we reviewed the messages, diffs and tests of the commits in the cakephp/cakephp tag 5.4.5 and the 4.x branch (up to 4.6.7) (31535d3, cb4f5d6, 106a75f, 3f696f2 and 47f2fb1, plus their backports to 4.x), as well as the Packagist release timestamps. For TwigView, we reviewed GHSA-hq9r-72jq-2pxp and GHSA-48qj-5wxh-m8hc in GitHub's advisory database, the fix commits in cakephp/twig-view (1c5107c, 99a5940 and 65f5035), and the composer.json of each version (desk research). On November 26, 2026, we reviewed the GitHub release notes and the 5.4.5 announcement on the official blog (Bakery), the “Supported Versions” page in the official documentation, tag comparisons for 5.3.9, 5.2.17 and 4.6.7 (from 5.3.8, 5.2.16 and 4.6.6), the repository advisories for cakephp/cakephp and cakephp/twig-view, and GitHub's advisory database. As of that time, no newer version such as 5.4.6 had been released, and no advisories or CVE numbers had yet been issued for the five core issues. We could not run the behavior before and after the fixes or reproduce each issue because of permissions in our working environment, so these have not been verified.
We covered updates to a CMS built on CakePHP in our baserCMS article, and an advisory for a Laravel admin panel component in our Filament Curator article. PHP's own November updates are summarized in our article on PHP's November fixes. CakePHP's Session applies its settings via ini_set(), so check it together with your PHP update.
For maintenance of business systems built with CakePHP or for planning framework updates, please contact us via Development, AI and automation consultation.
References
- CakePHP 5.4.5 and 4.6.7 Released (Bakery, November 22, 2026)
- cakephp/cakephp — Release 5.4.5(GitHub)
- CakePHP Supported Versions(CakePHP Book)
- cakephp/cakephp — Fix missing HTML escaping for checkbox values(#19795)
- cakephp/cakephp — Fix weakness in multicheckbox form inputs(#19810)
- cakephp/cakephp — Address weakness in WindowExpression and StringAggExpression(#19794)
- cakephp/cakephp — Add validation to WindowExpression::frame()(#19809)
- cakephp/cakephp — Fix header injection weakness to Http\Client requests(#19826)
- cakephp/cakephp — Backport fixes for WindowExpression to 4.x
- cakephp/cakephp(Packagist)
- GHSA-hq9r-72jq-2pxp(cakephp/twig-view、TwigView FileLoader may allow arbitrary file reads)
- GHSA-48qj-5wxh-m8hc(cakephp/twig-view、unserialize Twig filter allows arbitrary object deserialization)
- cakephp/twig-view — Backport security fixes to 1.x(#120)









