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

High severity, published 2026-07-02. Update craftcms/cms to 5.9.21 or later: composer update craftcms/cms.

Canonical URL: https://buzzphp.com/security/ghsa-x5m4-g2cq-52pq · Data from GitHub as of 2026-11-25.

| | |
| --- | --- |
| Severity | high |
| Published | 2026-07-02 |
| Updated | 2026-07-02 |
| CVE | [CVE-2026-50281](https://nvd.nist.gov/vuln/detail/CVE-2026-50281) |
| GHSA | [GHSA-x5m4-g2cq-52pq](https://github.com/advisories/GHSA-x5m4-g2cq-52pq) |
| Weakness | CWE-915 |

| Package | Affected versions | Fixed in |
| --- | --- | --- |
| craftcms/cms | >= 5.7.0, < 5.9.21 | 5.9.21 |

## What to do

Update craftcms/cms to 5.9.21 or later: composer update craftcms/cms.

Check which version you run with `composer show craftcms/cms`, and every affected package with `composer audit`.

## About this advisory

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.

## Links

- [GHSA-x5m4-g2cq-52pq on GitHub](https://github.com/advisories/GHSA-x5m4-g2cq-52pq)
- [CVE-2026-50281 on the National Vulnerability Database](https://nvd.nist.gov/vuln/detail/CVE-2026-50281)
- [All Composer security advisories](https://buzzphp.com/security)
