CVE-2026-50279: Craft CMS Authorship Spoofing Vulnerability

HIGH
Advisory Identifier: GHSA-qq2c-2q8j-jh27
CWE-285
Published
Advisory Summary

CVE-2026-50279 is a HIGH authorship spoofing vulnerability (CWE-285: Improper Authorization) affecting Craft CMS libraries in the Packagist ecosystem. The issue involves authorship spoofing in `entries/save-entry` via pre-check/post-mutation authorization gap. Remediation is available by upgrading affected packages to version 5.9.21.

CVE-2026-50279 at a Glance

CVE Identifier CVE-2026-50279
GHSA Identifier GHSA-qq2c-2q8j-jh27
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-285: Improper Authorization
Affected Product Craft CMS
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix CVE-2026-50279

To remediate this vulnerability, upgrade all affected Craft CMS dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

craftcms/cms fixed: 5.9.21
Upgrade craftcms/cms to 5.9.21
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for craftcms/cms

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-50279, inspect your project dependencies for Craft CMS:

inspect dependencies for craftcms/cms

Analyze the terminal output to locate any version of Craft CMS in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.9.21), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-285: Improper Authorization, where the product does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action. In Craft CMS, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary `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. ### Details The 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()`: ```php public function actionSaveEntry(bool $duplicate = false): ?Response { ... $entry = $this->_editableEntry($this->request->getBodyParam('entryId'), $siteId); ... $this->enforceEditEntryPermissions($entry, $duplicate); ... $this->_populateEntryModel($entry); ... $success = Craft::$app->getElements()->saveElement($entry); } ``` The attacker-controlled source is in [EntriesController.php](/D:/files/projects/cms-5.9.19/cms-5.9.19/src/controllers/EntriesController.php):588: ```php $entry->setAttributesFromRequest(array_filter([ 'authorIds' => $this->request->getBodyParam('authors') ?? $this->request->getBodyParam('author') ?? $entry->getAuthorId() ?? static::currentUser()->id, ])); ``` `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: ```php if ( ($authorIds !== null || $authorId !== null) && $this->canChangeAuthor() ) { $this->_oldAuthorIds = $oldAuthorIds; $this->setAuthorIds($authorIds); } ``` `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: ```php return ( empty($authorIds) || in_array($user->id, $authorIds) || $user->can("changeAuthorForPeerEntries:$section->uid") ); ``` After the author list is mutated, the controller does not re-check authorization. This closes the exploit chain: 1. External source: authenticated request to `entries/save-entry` with attacker-controlled `authors[]`. 2. Trust boundary failure: authorization is checked on the pre-mutation entry state, not on the post-mutation author assignment. 3. Privileged sink: the author relationship is rewritten in persistent storage. Preconditions derived from the source: 1. The attacker is authenticated and can edit entry `345`. 2. The attacker is among the existing authors of entry `345`, or otherwise satisfies `canChangeAuthor()` through the old author set. 3. The attacker has `viewPeerEntries` for the section. 4. User ID `1` exists and can be assigned as an author in that section. Result: 1. `enforceEditEntryPermissions()` succeeds on the original entry state. 2. `_populateEntryModel()` reads `authors[]=1` from the request body. 3. `setAttributesFromRequest()` updates `authorIds` because `canChangeAuthor()` is evaluated against the old authorship state. 4. `saveElement()` persists the change and `_saveAuthors()` rewrites the entry-author relation. 5. Entry `345` now appears authored by user `1`. ### Impact This 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.

CVE-2026-50279 Affected Craft CMS Versions

1 component(s)
Fixed Versions:
5.9.21
Product / Package Ecosystem Affected Versions Fixed Version
craftcms/cms
Packagist
≥ 5.0.0-RC1
< 5.9.21
5.9.21

References

Frequently Asked Questions

What is CVE-2026-50279?
CVE-2026-50279 is a security vulnerability in Craft CMS involving Authorship spoofing in `entries/save-entry` via pre-check/post-mutation authorization gap under CWE-285: Improper Authorization.
Which Craft CMS versions are affected?
Affected versions include releases prior to 5.9.21 across affected packages: craftcms/cms.
What version fixes CVE-2026-50279?
Upgrading to 5.9.21 (or the latest patched release for your respective branch) resolves the vulnerability.
Is craftcms/cms affected?
Yes, craftcms/cms is affected in releases prior to 5.9.21. Upgrade your dependency to 5.9.21 or later.
What CWE is associated with CVE-2026-50279?
CVE-2026-50279 is classified under CWE-285: Improper Authorization (The product does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action.).
How can I check Packagist dependencies for CVE-2026-50279?
Run the dependency tree command: 'inspect dependencies for craftcms/cms'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-qq2c-2q8j-jh27",
  "modified" : "2026-07-02T18:45:28Z",
  "published" : "2026-07-02T18:45:28Z",
  "aliases" : [ "CVE-2026-50279" ],
  "summary" : "Craft CMS: Authorship spoofing in `entries/save-entry` via pre-check/post-mutation authorization gap",
  "details" : "### 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.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "craftcms/cms"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0.0-RC1"
      }, {
        "fixed" : "5.9.21"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/craftcms/cms/security/advisories/GHSA-qq2c-2q8j-jh27"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-50279"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/craftcms/cms/commit/9cc493be8b414d7116c7f2bc2a6d0926e73f1248"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/craftcms/cms"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-285" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-02T18:45:28Z",
    "nvd_published_at" : "2026-07-02T00:16:44Z"
  }
}