BuzzPHP
LightDarkSystem

Craft CMS's mass assignment via id in newAttributes during bulk duplicate overwrites existing elements

High severity. Published 2 July 2026. Update craftcms/cms to 5.9.21 or later: composer update craftcms/cms.

Which versions are affected?

PackageAffected versionsFixed in
craftcms/cms (opens in a new tab)>= 5.7.0, < 5.9.215.9.21

What should you do?

Update every affected package you use to its fixed version, then check that nothing else in your project matches an advisory. To see which version you run, and whether anything is still affected:

composer show craftcms/cms
composer audit

Advisory details

SeverityHigh
Published
Updated
CVECVE-2026-50281 (opens in a new tab)
GHSAGHSA-x5m4-g2cq-52pq (opens in a new tab)
WeaknessCWE-915

What the advisory says

Summary

There is a mass-assignment flaw in the bulk-duplicate element action. Alice, holding only the permission to duplicate an entry she owns, submits an arbitrary id through the newAttributes request parameter. The duplication routine overrides its own id = null reset with that value and writes Alice’s attributes into Bob’s existing entry row.

Details

ElementsController::beforeAction() (src/controllers/ElementsController.php:119-124) pulls the request body into $this-attributes and rejects requests that ship an id or canonicalId key at the top level:

The check inspects only the top-level payload.

Source: GHSA-x5m4-g2cq-52pq (opens in a new tab) in the GitHub Advisory Database (CC BY 4.0). Data from GitHub (opens in a new tab) as of .

Other recent advisories for this package

All Composer security advisories