VYPR
Unrated severityNVD Advisory· Published Jun 21, 2026

phpMyFAQ - Privilege Escalation via Missing Authorization in editUser() and updateUserRights()

CVE-2026-56396

Description

phpMyFAQ before 4.1.4 contains missing authorization vulnerabilities in editUser() and updateUserRights() endpoints that allow authenticated administrators to escalate privileges. Non-SuperAdmin users with edit_user permission can set is_superadmin flag or grant arbitrary rights to escalate to SuperAdmin access.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

Affected products

2

Patches

Vulnerability mechanics

Root cause

"Missing authorization guards in editUser() and updateUserRights() allow non-SuperAdmin administrators with edit_user permission to set the is_superadmin flag or grant arbitrary rights."

Attack vector

An authenticated administrator who holds the delegable `edit_user` permission — but is not a SuperAdmin — can escalate privileges by sending a crafted request to `admin/api/user/edit` with `is_superadmin` set to `true`, causing the server to flip the actor's own `is_superadmin` flag to `1` [ref_id=1]. The same attacker can also call `admin/api/user/update-rights` to grant arbitrary rights (e.g. `editconfig`) to any account [ref_id=1]. The only gate on both endpoints is `userHasPermission(PermissionType::USER_EDIT)`, which the attacker already possesses. The attacker needs a valid authenticated session and a CSRF token, both of which are available to an authenticated admin [ref_id=1]. This is a classic case of missing authorization (CWE-862) and improper privilege management (CWE-269) [ref_id=1].

Affected code

The vulnerability resides in `editUser()` and `updateUserRights()` methods within `phpmyfaq/src/phpMyFAQ/Controller/Administration/Api/UserController.php`. The `editUser()` method (lines 419-476) accepts a user-controlled `is_superadmin` parameter and passes it to `$user->setSuperAdmin()` without checking whether the actor is a SuperAdmin. Similarly, `updateUserRights()` (lines 482-520) calls `grantUserRight()` with a user-controlled `userId` and right ID. Both endpoints only gate on `userHasPermission(PermissionType::USER_EDIT)`, which a non-SuperAdmin administrator can hold. The `setSuperAdmin()` method in `phpmyfaq/src/phpMyFAQ/User.php` (lines 950-962) performs no authorization check of its own.

What the fix does

The advisory recommends applying the same authorization invariant that was added to `overwritePassword()` in the 4.1.3 fix to the sibling endpoints [ref_id=1]. For `editUser()`, the fix must reject changes to `is_superadmin`, `status`, or 2FA fields unless the current user is a SuperAdmin, and must never allow a non-SuperAdmin to edit a SuperAdmin or protected target [ref_id=1]. For `updateUserRights()`, the fix must require `isSuperAdmin()` (or a privilege-level comparison) before calling `grantUserRight()`, forbid granting rights the actor does not itself hold, and forbid targeting SuperAdmin or protected users [ref_id=1]. The advisory notes that the 4.1.3 patch only touched `overwritePassword()` and `deleteUser()`, leaving these two methods unguarded [ref_id=1].

Preconditions

  • authAttacker must have a valid authenticated session as an administrator
  • authAttacker must hold the delegable 'edit_user' permission (non-SuperAdmin)
  • inputAttacker must obtain a valid CSRF token (available from admin pages)

Generated on Jun 22, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

2

News mentions

0

No linked articles in our index yet.