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?
| Package | Affected versions | Fixed in |
|---|---|---|
| craftcms/cms (opens in a new tab) | >= 5.7.0, < 5.9.21 | 5.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 auditAdvisory details
| Severity | High |
|---|---|
| Published | |
| Updated | |
| CVE | CVE-2026-50281 (opens in a new tab) |
| GHSA | GHSA-x5m4-g2cq-52pq (opens in a new tab) |
| Weakness | CWE-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
- Craft CMS: Passkey login accepts replayed WebAuthn assertions (critical, 7 August 2026)
- Craft CMS: Authorization bypass: view-only Categories user can modify category structure via structures/move-element (opens in a new tab) (medium, 6 August 2026)
- Craft CMS: Missing authorization check allows non-admin control panel users access to user registration metrics (opens in a new tab) (medium, 6 August 2026)
- Craft CMS: Arbitrary user password reset leading to administrator account takeover (high, 6 August 2026)
- Craft CMS: Authenticated RCE through Twig sandbox escape (high, 6 August 2026)