Details
Suggested Fix
Apply the same self-rights constraint updateUserRights already has, before granting:
$actingIsSuperAdmin = $this->currentUser->isSuperAdmin();
if (!$actingIsSuperAdmin) {
$actingUserId = $this->currentUser->getUserId();
foreach ($groupPermissions as $groupPermission) {
if (!$this->currentUser->perm->hasPermission($actingUserId, (int) $groupPermission)) {
throw new UnauthorizedHttpException('Cannot grant a right you do not hold');
}
}
}
More robustly, factor the "you may only assign rights you hold" rule into the permission layer (grantGroupRight / grantUserRight) so both the user-rights and group-rights paths enforce it uniformly, and add a regression test mirroring testUpdateRightsNonSuperAdminCannotGrantRightTheyDoNotHold for the group endpoint. (See also the related sibling gaps in the same admin-API authorization series: UserController::addUser missing the acting-SuperAdmin guard, and the user/data / user/permissions target-authorization on read.)
Disclosure Timeline
- 2026-05-30: Discovered while auditing the completeness of the GHSA-xvp4 / GHSA-985r / GHSA-8c6h admin-API authorization-hardening series at
mainHEAD04db2b999d8d. The self-rights constraint added toupdateUserRightswas confirmed absent on theGroupController::updatePermissionssibling by reading both handlers + the permission gate + thegrantGroupRightsink. - 2026-05-30: Drafted for submission via GitHub Security Advisory.
References
- Hardening series this incompletely fixes: GHSA-xvp4-phqj-cjr3, GHSA-985r-q3qp-299h ("incomplete fix for GHSA-xvp4"), GHSA-8c6h-7g6x-m5x4 ("incomplete fix for CVE-2026-24421").
- Affected source:
phpmyfaq/src/phpMyFAQ/Controller/Administration/GroupController.php:309-349(updatePermissions, gateuserHasPermission(GROUP_EDIT)at:311, sinkgrantGroupRightat:329); fixed siblingController/Administration/Api/UserController.php:534-589(updateUserRights, self-rights loop at:563-566);Controller/AbstractController.php:326-336(userHasPermission, the only gate —GROUP_EDITaction permission). - Companion advisory (same audit, same series):
user/addmissing acting-SuperAdmin guard -> delegated admin creates SuperAdmin (8.8 High).