/

CVE-2026-57996

Severity:

HIGH RISK

(8.8)

Privilege Escalation (CWE-269) in phpMyFAQ User API

CVE-2026-57996

Deferred

Vulnerability type

Category:

Privilege Escalation

CWE:

CWE-269

Impact:

Admin Privilege Escalation and Instance Takeover

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

phpMyFAQ before 4.1.5 contains a privilege escalation flaw in the user/add admin API that lets delegated administrators create new SuperAdmin accounts by setting an isSuperAdmin flag.

If an attacker controls an admin account with user management rights, they can create a SuperAdmin user with arbitrary credentials and then log in as that user to fully take over the instance.

Affected context

This vulnerability arises in phpMyFAQ deployments where non-SuperAdmin administrators are granted permissions to add, edit, or delete users via the admin API.

The risky behavior occurs when the POST /admin/api/user/add endpoint accepts privilege-related attributes (such as isSuperAdmin) from these lower-privileged accounts without sufficient server-side enforcement.

Environments that delegate user lifecycle operations to mid-level admins, or that expose the admin API over internal networks, are more likely to be impacted.

Exploit preconditions

  • Attack surface: Authenticated phpMyFAQ admin interface and its /admin/api/user/add endpoint.
  • Required access: An administrator account with USER_ADD, USER_EDIT, or USER_DELETE permissions but not SuperAdmin privileges.
  • Trigger point: Sending a POST /admin/api/user/add request that includes isSuperAdmin: true along with attacker-chosen username and password.
  • Why exploitation is possible: The backend logic does not sufficiently enforce role boundaries and allows lower-privileged admins to assign the highest privilege level to new accounts, violating the principle of least privilege (CWE-269).

Why this happens

The root cause is improper privilege management in the authorization logic for user creation.

The application trusts that any administrator with user management permissions may set high-privilege flags (e.g., isSuperAdmin) without re-validating the caller's own role or enforcing a permission check specific to SuperAdmin creation.

This maps to CWE-269: Improper Privilege Management, where the system fails to restrict operations that change or grant elevated privileges to appropriately authorized roles, enabling indirect escalation through legitimate functionality.

Potential impact

  • An attacker-controlled administrator account can create new SuperAdmin users.
  • Full phpMyFAQ instance takeover via elevated SuperAdmin access.
  • Modification or deletion of all FAQs, categories, and configuration data.
  • Creation of additional backdoor accounts with persistent high privileges.
  • Potential chaining into broader application or infrastructure compromises if phpMyFAQ is integrated with other systems.

General mitigation guidance

Mitigation generally focuses on tightening authorization rules around privilege-changing operations and reinforcing least-privilege role design.

Useful patterns include:

  • Restricting creation, modification, and deletion of high-privilege roles (such as SuperAdmin) to a small, dedicated privilege set distinct from general user management rights.
  • Implementing server-side checks that validate the caller's role before allowing privilege flags like isSuperAdmin to be set or changed, ignoring such flags from lower-privileged callers.
  • Centralizing role and permission checks in an authorization layer rather than trusting client-supplied fields in API requests.
  • Designing roles so that delegated administrators manage ordinary users only, without any capability to assign or escalate to top-level privileges.
  • Logging and monitoring all role changes and high-privilege account creations to support rapid detection and response.

How teams detect issues like this

Effective detection relies on examining both code and runtime behavior for improper privilege management patterns.

Common approaches include:

  • Static analysis and code review focused on user-management endpoints, checking that any operation which sets or modifies roles, privilege flags, or SuperAdmin status performs explicit authorization checks tied to the caller's role.
  • Searching for API handlers that accept privilege-related parameters (e.g., isSuperAdmin, role, permissions) from clients and verifying that these are not blindly trusted or persisted.
  • Implementing security policies that flag high-privilege account creation events, especially those initiated by non-SuperAdmin accounts, and sending alerts for review.
  • Using automated application security testing tools to probe admin APIs for privilege escalation by attempting to set elevated roles from lower-privileged test accounts.

Sources

SourceLink
github.comgithub.com/thorsten/phpMyFAQ/security/advisories/GHSA-r2f4-v277-hvw9
vulncheck.comvulncheck.com/advisories/phpmyfaq-privilege-escalation-via-missing-superadmin-guard-in-user-add-endpoint

Frequently asked

questions

No. Exploitation requires an authenticated administrator account with user management permissions. Regular end-users without admin rights cannot directly exploit this issue.

The attacker must control or compromise an administrator account that has USER_ADD, USER_EDIT, or USER_DELETE permissions. With these rights, they can call the user/add API and create a new SuperAdmin account.

The safest pattern is to enforce strict authorization checks on any operation that creates, modifies, or deletes high-privilege roles. Only existing SuperAdmins (or an equivalent top-level role) should be allowed to set flags like isSuperAdmin, and the server must ignore such flags from lower-privileged accounts.

Future designs should separate user lifecycle management from privilege assignment, apply least-privilege principles to administrative roles, centralize authorization decisions, and treat all client-supplied role or permission fields as untrusted data that must be validated server-side against the caller's actual permissions.

Find out what's already
exploitable in your codebase.