/

CVE-2026-62666

Severity:

HIGH RISK

(8.8)

Privilege Escalation (CWE-639) in Grav CMS API Plugin

CVE-2026-62666

Deferred

Vulnerability type

Category:

Authorization Bypass and Privilege Escalation

CWE:

CWE-639, CWE-862

Impact:

Account Takeover and Privilege Escalation

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 API Plugin contains an authorization flaw in user-management operations that can allow a lower-privileged account with user-write access to create or manipulate credentials associated with a super-administrator target.

Because API key scopes are not adequately enforced and required super-user checks are omitted, successful exploitation may provide persistent administrator access and allow two-factor authentication changes.

Affected context

The issue occurs in Grav API Plugin deployments where a non-super account has the api.users.write permission and can reach the API endpoints responsible for API key and two-factor authentication management. Risk is present when target authorization checks are incomplete and generated API keys are not constrained to the privileges intended for the requesting account.

Exploit preconditions

  • Attack surface: Grav API Plugin user-management endpoints
  • Required access: An authenticated account with api.users.write
  • Trigger point: API key creation or two-factor authentication management for a privileged user target
  • Why exploitation is possible: The affected operations omit the super-user target authorization check, while API key permission scopes are not enforced consistently

Why this happens

The underlying flaw is an authorization enforcement gap in sensitive user mutation operations. The affected methods do not apply the same accessGrantsSuper() target check used by related endpoints, allowing a lower-privileged account to act on a super-administrator target.

This maps primarily to CWE-639: Authorization Bypass Through User-Controlled Key, because target identity and privilege context are not sufficiently restricted. It also relates to CWE-862: Missing Authorization, as the required authorization decision is absent from specific mutation paths.

Potential impact

  • An attacker may create an API key associated with super-administrator privileges
  • The attacker could obtain persistent privileged access to Grav
  • Two-factor authentication for a privileged account could be rotated or disabled
  • Site content, configuration, and user accounts could be modified
  • A compromised account could support further administrative or operational abuse

General mitigation guidance

Mitigation generally focuses on enforcing authorization consistently across every sensitive user-management operation.

Common defensive patterns include:

  • Apply explicit target-level authorization checks to API key and two-factor authentication mutations
  • Enforce API key scopes and privilege boundaries at both creation time and request time
  • Prevent lower-privileged users from selecting or modifying higher-privileged targets
  • Use centralized authorization policies rather than endpoint-specific assumptions
  • Require reauthentication or additional approval for privileged credential changes
  • Apply least privilege to API accounts and administrative roles
  • Review existing keys and two-factor authentication settings for unexpected privileged changes

How teams detect issues like this

Organizations can look for this class of issue through:

  • Static analysis rules that compare authorization checks across sibling user mutation endpoints
  • Code review searches for credential, API key, and MFA operations lacking target-level permission checks
  • Tests verifying that lower-privileged accounts cannot mutate super-administrator targets
  • Policy enforcement requiring API key scopes to be validated during both issuance and use
  • Audit logging and alerting for privileged API key creation, scope changes, and two-factor authentication resets
  • Automated security review tools that identify missing authorization branches and inconsistent access-control enforcement

Sources

SourceLink
github.comgithub.com/getgrav/grav-plugin-api/commit/dfcc947f0d6758772caac290c68fe8d4c4a4874e
github.comgithub.com/getgrav/grav-plugin-api/releases/tag/1.0.6
github.comgithub.com/getgrav/grav/security/advisories/GHSA-8gg4-rvvv-cq96

Frequently asked

questions

It can be remotely exploitable when the Grav API is reachable and an attacker has valid credentials for an account with the required user-write permission.

Generally, no. Exploitation requires authenticated access with sufficient permission to invoke the affected user-management operations, although the account need not be a super-administrator.

Apply the same target-level super-user authorization checks to every affected mutation and enforce API key scopes so generated credentials cannot exceed the issuer's authorized privilege.

Centralize authorization decisions, test privilege boundaries for every sensitive endpoint, require strong controls for credential and MFA changes, and monitor audit events involving privileged accounts.

Find out what's already
exploitable in your codebase.