Know every vulnerabilitybefore it knows you.
DevGuard continuously monitors your dependencies and alerts you when CVEs like this one affect your stack — with real-time threat intelligence built for developers.
GHSA-jq2f-59pj-p3m3
No affected components available
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
viewUserspermission was added - Prior to 5.6.0,
editedUser()requirededitUsers, 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:
-
actionSavePermissions()reachable with read-only access: The action only requires a control panel request and delegates toeditedUser(), which now only checksviewUsers— a permission explicitly documented as "read-only access to user elements." -
Asymmetric authorization in
_saveUserGroups(): The method checksassignUserGrouppermission only when adding a user to a new group. When thegroupsparameter 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
accessCpandviewUserspermissions only - Target user belongs to one or more user groups that grant additional permissions
- Pro edition or higher
Attack Steps
- Attacker authenticates to the Control Panel
- Attacker sends a POST request to
actions/users/save-permissionswith:userId= target user's IDgroups= `` (empty string)
- All group memberships for the target user are removed
- 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)
The vulnerability can be exploited over the network without needing physical access. It is easy for an attacker to exploit this vulnerability. An attacker needs basic access or low-level privileges. No user interaction is needed for the attacker to exploit this vulnerability.
Limited exploitation activity has been observed. Close monitoring and planned remediation are recommended.
The exploit probability is very low. The vulnerability is unlikely to be exploited in the next 30 days.
We did not find any exploit available. Neither in GitHub repositories nor in the Exploit-Database.
Browse More
Continuously monitor your dependencies and get alerted when vulnerabilities like this one affect your stack.
Checkout DevGuard