{"id":"CVE-2026-50279","aliases":["CVE-2026-50279","GHSA-qq2c-2q8j-jh27"],"related":[],"kind":"vulnerability","state":"published","title":"Craft CMS: Authorship spoofing in `entries/save-entry` via pre-check/post-mutation authorization gap","summary":"Craft CMS is a content management system (CMS). IN versions 5.0.0-RC1 and above prior to 5.9.21, theEntriesController::actionSaveEntry() performs entry-edit permission checks before request-controlled author changes are applied to the model, allowing for authorship spoofing. The subsequent author mutation path accepts attacker-supplied authors / author parameters and allows the change when the current user is one of the old authors. Because the controller does not re-run authorization after mutating the author list, a low-privileged user can reassign an entry’s authorship to another user without holding the dedicated peer-author-change permission. This issue has been fixed in version 5.9.21.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Craft CMS is a content management system (CMS). IN versions 5.0.0-RC1 and above prior to 5.9.21, theEntriesController::actionSaveEntry() performs entry-edit permission checks before request-controlled author changes are applied to the model, allowing for authorship spoofing. The subsequent author mutation path accepts attacker-supplied authors / author parameters and allows the change when the current user is one of the old authors. Because the controller does not re-run authorization after mutating the author list, a low-privileged user can reassign an entry’s authorship to another user without holding the dedicated peer-author-change permission. This issue has been fixed in version 5.9.21.","source":"cvelist"},{"lang":"en","text":"### Summary\n\n`EntriesController::actionSaveEntry()` performs entry-edit permission checks before request-controlled author changes are applied to the model. The subsequent author mutation path accepts attacker-supplied `authors` / `author` parameters and allows the change when the current user is one of the old authors. Because the controller does not re-run authorization after mutating the author list, a low-privileged user can reassign an entry’s authorship to another user without holding the dedicated peer-author-change permission.\n\n### Details\nThe control flow begins in [EntriesController.php](/D:/files/projects/cms-5.9.19/cms-5.9.19/src/controllers/EntriesController.php):249. `actionSaveEntry()` loads the entry and enforces edit permissions before calling `_populateEntryModel()`:\n\n```php\npublic function actionSaveEntry(bool $duplicate = false): ?Response\n{\n    ...\n    $entry = $this->_editableEntry($this->request->getBodyParam('entryId'), $siteId);\n    ...\n    $this->enforceEditEntryPermissions($entry, $duplicate);\n    ...\n    $this->_populateEntryModel($entry);\n    ...\n    $success = Craft::$app->getElements()->saveElement($entry);\n}\n```\n\nThe attacker-controlled source is in [EntriesController.php](/D:/files/projects/cms-5.9.19/cms-5.9.19/src/controllers/EntriesController.php):588:\n\n```php\n$entry->setAttributesFromRequest(array_filter([\n    'authorIds' => $this->request->getBodyParam('authors') ??\n        $this->request->getBodyParam('author') ??\n        $entry->getAuthorId() ??\n        static::currentUser()->id,\n]));\n```\n\n`Entry::setAttributesFromRequest()` in [Entry.php](/D:/files/projects/cms-5.9.19/cms-5.9.19/src/elements/Entry.php):1124 extracts the new author IDs and applies them if `canChangeAuthor()` returns true:\n\n```php\nif (\n    ($authorIds !== null || $authorId !== null) &&\n    $this->canChangeAuthor()\n) {\n    $this->_oldAuthorIds = $oldAuthorIds;\n    $this->setAuthorIds($authorIds);\n}\n```\n\n`canChangeAuthor()` at [Entry.php](/D:/files/projects/cms-5.9.19/cms-5.9.19/src/elements/Entry.php):2789 allows the author change when the current user can view peer entries and is already one of the existing authors:\n\n```php\nreturn (\n    empty($authorIds) ||\n    in_array($user->id, $authorIds) ||\n    $user->can(\"changeAuthorForPeerEntries:$section->uid\")\n);\n```\n\nAfter the author list is mutated, the controller does not re-check authorization. \n\nThis closes the exploit chain:\n\n1. External source: authenticated request to `entries/save-entry` with attacker-controlled `authors[]`.\n2. Trust boundary failure: authorization is checked on the pre-mutation entry state, not on the post-mutation author assignment.\n3. Privileged sink: the author relationship is rewritten in persistent storage.\n\nPreconditions derived from the source:\n\n1. The attacker is authenticated and can edit entry `345`.\n2. The attacker is among the existing authors of entry `345`, or otherwise satisfies `canChangeAuthor()` through the old author set.\n3. The attacker has `viewPeerEntries` for the section.\n4. User ID `1` exists and can be assigned as an author in that section.\n\nResult:\n\n1. `enforceEditEntryPermissions()` succeeds on the original entry state.\n2. `_populateEntryModel()` reads `authors[]=1` from the request body.\n3. `setAttributesFromRequest()` updates `authorIds` because `canChangeAuthor()` is evaluated against the old authorship state.\n4. `saveElement()` persists the change and `_saveAuthors()` rewrites the entry-author relation.\n5. Entry `345` now appears authored by user `1`.\n\n### Impact\n\nThis allows low-privileged users to falsify content ownership and alter the authorship of entries without having the dedicated author-management permission. The impact includes corrupted audit trails, misleading notifications, broken approval workflows, and unauthorized reassignment of content responsibility.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Craft CMS es un sistema de gestión de contenido (CMS). En las versiones 5.0.0-RC1 y superiores anteriores a la 5.9.21, el método theEntriesController::actionSaveEntry() realiza comprobaciones de permisos de edición de entradas antes de que los cambios de autor controlados por la solicitud se apliquen al modelo, lo que permite la suplantación de autoría. La ruta de mutación de autor subsiguiente acepta autores / parámetros de autor proporcionados por el atacante y permite el cambio cuando el usuario actual es uno de los autores antiguos. Debido a que el controlador no vuelve a ejecutar la autorización después de mutar la lista de autores, un usuario con pocos privilegios puede reasignar la autoría de una entrada a otro usuario sin poseer el permiso dedicado de cambio de autor par. Este problema ha sido solucionado en la versión 5.9.21.","source":"nvd"}],"published":"2026-07-01T23:31:31.101Z","modified":"2026-10-25T21:10:00.770Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N","score":7.6,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N","score":7.6,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N","rating":"HIGH"}],"cwes":["CWE-285"],"affected":[{"ranges":[{"version":">= 5.0.0-RC1, < 5.9.21","status":"affected"}],"vendor":"craftcms","product":"cms","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"5.0.0-RC1","status":"affected","fixed":"5.9.21"}],"ecosystem":"Packagist","package":"craftcms/cms","purl":"pkg:composer/craftcms/cms","source":"ghsa"}],"references":[{"url":"https://github.com/craftcms/cms/security/advisories/GHSA-qq2c-2q8j-jh27","tags":["exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/craftcms/cms/commit/9cc493be8b414d7116c7f2bc2a6d0926e73f1248","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-50279","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/craftcms/cms","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2026-07-02T12:27:22.397Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-50279","url":"https://www.cve.org/CVERecord?id=CVE-2026-50279","licence":"CVE Terms of Use","modified":"2026-07-02T12:27:42.242Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-qq2c-2q8j-jh27","url":"https://github.com/advisories/GHSA-qq2c-2q8j-jh27","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:52.940Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-50279","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-50279","licence":"Public domain","modified":"2026-10-25T21:10:00.770Z"}],"updatedAt":"2026-11-25T22:59:26.985Z","epss":{"score":0.00245,"percentile":0.169,"date":"2026-12-01T12:00:22.000Z"}}