GHSA-JQ2F-59PJ-P3M3

Vulnerability from github – Published: 2026-04-14 23:34 – Updated: 2026-04-14 23:34
VLAI?
Summary
Craft CMS has a Missing Authorization Check on User Group Removal via save-permissions Action
Details

Summary

The actionSavePermissions() endpoint allows a user with only viewUsers permission to remove arbitrary users from all user groups. While _saveUserGroups() enforces per-group authorization for additions, it performs no equivalent authorization check for removals, so submitting an empty groups value removes all existing group memberships.

Affected Versions

  • Craft CMS 5.6.0 through 5.9.14 (latest release at time of report)
  • Regression introduced in 5.6.0 when the viewUsers permission was added
  • Prior to 5.6.0, editedUser() required editUsers, which implicitly protected this endpoint
  • Requires Pro edition or higher (the vulnerable code path is gated by CmsEdition::Pro)

Vulnerability Details

Root Cause

This is a regression introduced in Craft CMS 5.6.0 when the viewUsers permission was added. Before that change, editedUser() required editUsers permission for accessing other users’ data, which implicitly protected actionSavePermissions(). After the change, actionSavePermissions() became reachable for users with read-only access to other users, but the underlying group-saving logic still lacked authorization for group removals.

The vulnerability has two components:

  1. actionSavePermissions() reachable with read-only access: The action only requires a control panel request and delegates to editedUser(), which now only checks viewUsers — a permission explicitly documented as "read-only access to user elements."

  2. Asymmetric authorization in _saveUserGroups(): The method checks assignUserGroup permission only when adding a user to a new group. When the groups parameter is an empty string (resulting in an empty array), the loop is skipped entirely, no authorization checks are run, and all group memberships are removed.

Prerequisites

  • Attacker has a control panel account with accessCp and viewUsers permissions only
  • Target user belongs to one or more user groups that grant additional permissions
  • Pro edition or higher

Attack Steps

  1. Attacker authenticates to the Control Panel
  2. Attacker sends a POST request to actions/users/save-permissions with:
  3. userId = target user's ID
  4. groups = `` (empty string)
  5. All group memberships for the target user are removed
  6. All permissions inherited from those groups are immediately revoked

Impact

  • Privilege revocation: An attacker can strip group-based permissions from arbitrary users, including accounts whose effective access derives from group membership
  • Denial of access: Users lose access to sections, volumes, and features that were granted through group membership
  • Bypass of elevated session requirement: Group removal does not trigger requireElevatedSession() (which is only triggered when new groups are added)
Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Packagist",
        "name": "craftcms/cms"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "5.6.0"
            },
            {
              "fixed": "5.9.15"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [],
  "database_specific": {
    "cwe_ids": [
      "CWE-862"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-04-14T23:34:52Z",
    "nvd_published_at": null,
    "severity": "MODERATE"
  },
  "details": "## Summary\n\nThe `actionSavePermissions()` endpoint allows a user with only `viewUsers` permission to remove arbitrary users from all user groups. While `_saveUserGroups()` enforces per-group authorization for additions, it performs no equivalent authorization check for removals, so submitting an empty `groups` value removes all existing group memberships.\n\n## Affected Versions\n\n- Craft CMS 5.6.0 through 5.9.14 (latest release at time of report)\n- Regression introduced in 5.6.0 when the `viewUsers` permission was added\n- Prior to 5.6.0, `editedUser()` required `editUsers`, which implicitly protected this endpoint\n- Requires Pro edition or higher (the vulnerable code path is gated by `CmsEdition::Pro`)\n\n## Vulnerability Details\n\n### Root Cause\n\nThis is a **regression** introduced in Craft CMS 5.6.0 when the `viewUsers` permission was added. Before that change, `editedUser()` required `editUsers` permission for accessing other users\u2019 data, which implicitly protected `actionSavePermissions()`. After the change, `actionSavePermissions()` became reachable for users with read-only access to other users, but the underlying group-saving logic still lacked authorization for group removals.\n\nThe vulnerability has two components:\n\n1. **`actionSavePermissions()` reachable with read-only access**: The action only requires a control panel request and delegates to `editedUser()`, which now only checks `viewUsers` \u2014 a permission explicitly documented as \"read-only access to user elements.\"\n\n2. **Asymmetric authorization in `_saveUserGroups()`**: The method checks `assignUserGroup` permission only when **adding** a user to a new group. When the `groups` parameter is an empty string (resulting in an empty array), the loop is skipped entirely, no authorization checks are run, and all group memberships are removed.\n\n### Prerequisites\n\n- Attacker has a control panel account with `accessCp` and `viewUsers` permissions only\n- Target user belongs to one or more user groups that grant additional permissions\n- Pro edition or higher\n\n### Attack Steps\n\n1. Attacker authenticates to the Control Panel\n2. Attacker sends a POST request to `actions/users/save-permissions` with:\n   - `userId` = target user\u0027s ID\n   - `groups` = `` (empty string)\n3. All group memberships for the target user are removed\n4. All permissions inherited from those groups are immediately revoked\n\n### Impact\n\n- **Privilege revocation**: An attacker can strip group-based permissions from arbitrary users, including accounts whose effective access derives from group membership\n- **Denial of access**: Users lose access to sections, volumes, and features that were granted through group membership\n- **Bypass of elevated session requirement**: Group removal does not trigger `requireElevatedSession()` (which is only triggered when new groups are added)",
  "id": "GHSA-jq2f-59pj-p3m3",
  "modified": "2026-04-14T23:34:52Z",
  "published": "2026-04-14T23:34:52Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/craftcms/cms/security/advisories/GHSA-jq2f-59pj-p3m3"
    },
    {
      "type": "WEB",
      "url": "https://github.com/craftcms/cms/commit/b135384808ad43fcf8836a9dd9b877fb0087bc27"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/craftcms/cms"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N",
      "type": "CVSS_V4"
    }
  ],
  "summary": "Craft CMS has a Missing Authorization Check on User Group Removal via save-permissions Action"
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.


Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…