highVulnerability

CVE-2026-50281

## 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: ```php $this->_attributes = $this->request->getBodyParams(); // No funny business if (isset($this->_attributes['id']) || isset($this->_attributes['canonicalId'])) { throw new BadRequestHttpException('Changing an element’s ID is not allowed.'); } ``` The check inspects only the top-level payload. `actionBulkDuplicate()` (`src/controllers/ElementsController.php:1708-1749`) reads a separate `newAttributes` array and passes it straight through to the service layer: ```php $elementInfo = $this->request->getRequiredBodyParam('elements'); $newAttributes = $this->request->getRequiredBodyParam('newAttributes'); ... $safeNewAttributes = Collection::make($newAttributes) ->only($element->safeAttributes()) ->all(); ... $newElement = $elementsService->duplicateElement( $element, $safeNewAttributes + $element::baseBulkDuplicateAttributes(), false, checkAuthorization: true, ); ``` `Elements::duplicateElement()` (`src/services/Elements.php:1814-1840`) clones the source element, sets `id` to null, and then hands the attacker's array to `Craft::configure()`: ```php $mainClone = clone $element; $mainClone->id = null; $mainClone->uid = StringHelper::UUID(); ... Craft::configure($mainClone, ArrayHelper::merge( $newAttributes, $siteAttributes[$mainClone->siteId] ?? [], )); ``` `Craft::configure()` overwrites the reset `id` with any numeric value inside `$newAttributes`.

Properties

ghsa_id
GHSA-x5m4-g2cq-52pq
summary
Craft CMS's mass assignment via id in newAttributes during bulk duplicate overwrites existing elements
severity
high
epss_score
0.00253
cve_id
CVE-2026-50281
is_ghsa_only
false
ghsa_published
2026-07-02T20:03:36Z
source_url
https://github.com/advisories/GHSA-x5m4-g2cq-52pq
epss_percentile
0.17081
ghsa_updated
2026-07-02T20:03:36Z

Related Entities (5)

ENRICHED_BY (1)

[Source]FIRST EPSS

REPORTED_BY (1)

[Source]GitHub Advisory Database

VULNERABLE_TO (1)

[Software]composer/craftcms/cms

AFFECTS (1)

[Software]composer/craftcms/cms

HAS_WEAKNESS (1)

[Weakness]Improperly Controlled Modification of Dynamically-Determined Object Attributes

Explore deeper with Ninja Signal's threat intelligence graph

CVE-2026-50281 — Ninja Signal Threat Intelligence | Ninja Signal