Advisory

GHSA-pg62-f8g4-4wqh

Details, part 2 of 2. The advisory

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 main HEAD 04db2b999d8d. The self-rights constraint added to updateUserRights was confirmed absent on the GroupController::updatePermissions sibling by reading both handlers + the permission gate + the grantGroupRight sink.
  • 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, gate userHasPermission(GROUP_EDIT) at :311, sink grantGroupRight at :329); fixed sibling Controller/Administration/Api/UserController.php:534-589 (updateUserRights, self-rights loop at :563-566); Controller/AbstractController.php:326-336 (userHasPermission, the only gate — GROUP_EDIT action permission).
  • Companion advisory (same audit, same series): user/add missing acting-SuperAdmin guard -> delegated admin creates SuperAdmin (8.8 High).

Sources & licences