/

CVE-2026-62233

Severity:

HIGH RISK

(8.8)

Broken AuthZ (CWE-639) in Grav API Admin Endpoints

CVE-2026-62233

Deferred

Vulnerability type

Category:

Broken Access Control

CWE:

CWE-639, CWE-862

Impact:

Privilege Escalation to Super-Admin and Account 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

Grav's API plugin fails to properly validate super-admin status in several sensitive endpoints, allowing lower-privileged managers to perform super-admin-only actions.

Under misconfigured or insufficient access checks, attackers with api.users.write privileges can escalate to super-admin, mint powerful API keys, or disable 2FA protections, leading to full instance takeover.

Affected context

This vulnerability occurs in Grav deployments using the API plugin where role-based authorization for administrative operations is not strictly enforced.

The affected endpoints (such as createApiKey, generate2fa, and disable2fa) rely on insufficient checks that treat api.users.write managers as if they were super-admins.

The issue is most relevant in environments with multiple delegated admins or API users, where separation of duties is expected but not fully enforced in the plugin's access control logic.

Exploit preconditions

  • Attack surface: HTTP API endpoints exposed by the Grav API plugin
  • Required access: An account or API client with at least api.users.write or similar user-management privileges, but not super-admin
  • Trigger point: Invoking createApiKey, generate2fa, or disable2fa endpoints targeting super-admin user accounts
  • Why exploitation is possible: The endpoints authorize based on generic user-management capabilities without confirming that the caller holds super-admin status, resulting in vertical privilege escalation (CWE-639, CWE-862)

Why this happens

The root cause is incomplete authorization logic in high-privilege API endpoints.

Instead of explicitly verifying that the caller is a super-admin, the plugin relies on broader user-management permissions (such as api.users.write) to gate access.

This maps to CWE-639: Authorization Bypass Through User-Controlled Keys, because the attacker can operate on super-admin user identifiers without appropriate privilege checks, and CWE-862: Missing Authorization, where critical security-sensitive actions lack robust role validation.

Abstractly, this reflects a broken access control pattern in which sensitive administrative functions are exposed to roles that should not have vertical escalation capability.

Potential impact

  • Attackers can escalate from manager-level roles to effective super-admin privileges
  • Creation of API keys bound to super-admin accounts, enabling persistent and automated control over the instance
  • Disabling or bypassing two-factor authentication for super-admin users, weakening account security
  • Full Grav instance takeover, including content modification, user management, and configuration changes
  • Potential integration abuse, such as manipulating webhooks, plugins, or connected services via elevated API keys

General mitigation guidance

Mitigation typically focuses on strengthening role-based authorization and enforcing least privilege for administrative endpoints.

Recommended patterns include:

  • Implement explicit role checks for super-admin-only operations, ensuring that user-management permissions alone are not sufficient
  • Centralize authorization rules so that all API endpoints use a common policy engine rather than ad hoc checks
  • Treat operations that affect super-admin accounts (API key creation, 2FA management) as highly sensitive and require stronger verification or step-up authentication
  • Apply the principle of least privilege to API roles, separating read, write, and administrative capabilities and avoiding broad catch-all permissions
  • Log and monitor administrative API usage for anomaly detection and incident response

How teams detect issues like this

Detection can focus on both source-level patterns and runtime behavior:

  • Use static analysis or manual code review to verify that all security-sensitive endpoints perform explicit role checks (e.g., confirming super-admin status) before executing
  • Look for API handlers that accept user IDs or account identifiers but do not validate that the caller is authorized to manage those specific accounts
  • Enforce secure coding guidelines for access control, such as requiring a centralized authorization helper and prohibiting direct user role comparisons in endpoint logic
  • Monitor logs for suspicious administrative actions originating from non-super-admin accounts, including API key creation or 2FA changes on privileged users
  • Integrate automated security testing in CI to flag missing authorization checks and privilege escalation flows in new or updated endpoints

Sources

SourceLink
github.comgithub.com/getgrav/grav/security/advisories/GHSA-8gg4-rvvv-cq96
vulncheck.comvulncheck.com/advisories/grav-plugin-api-privilege-escalation-via-createapikey

Frequently asked

questions

Exploitation requires an account or API client with user-management capabilities, so it is most relevant in environments where multiple administrators or API managers exist. It does not affect completely unauthenticated attackers.

An attacker needs non-super but still privileged access, such as api.users.write or equivalent manager roles that can call the affected endpoints. From there, they can act on super-admin accounts due to missing authorization checks.

The safest fix is to enforce explicit super-admin role checks on all endpoints that manage super-admin credentials or 2FA, using a centralized authorization mechanism. Any action that operates on privileged accounts should require a matching privileged role and, ideally, step-up verification.

Preventing similar issues involves designing a clear role model, enforcing least privilege, centralizing authorization logic, and subjecting all new administrative endpoints to security review. Automated checks, such as static analysis and policy enforcement in CI, can help ensure that no sensitive operation is exposed without proper authorization.

Find out what's already
exploitable in your codebase.